Across the mountains and rivers, Pisces finally came to the dragon. Now it's time to fight! There are some energy stones in Pisces's backpack, and each of them belongs to exactly one of the three categories: fire, wind, and soil. To launch an attack, Pisces has to consume 3 energy stones, which must contain at least 1 fire stone and 1 wind stone. Given the number of each kind of stones, Pisces wants to know what is the maximum number of attacks that he can launch.