How to find out how many cubes it takes? Can someone explain to me how to do the how many cubes does it take thing?

Example: 
Kayla stacked her cubes to make this rectangular prism. 


How many cubes did Kayla use? 


How To Find Out How Many Cubes It Takes Can Someone Explain To Me How To Do The How Many Cubes Does It Take ThingExample Kayla Stacked Her Cubes To Make This Re class=