A topless cardboard box, 5 cm by 5 cm by 5 cm, is filled with 1-cm-by-1-cm-by-1-cm cubes. How many of the cubes touch cardboard?
A 5 cm by 5 cm by 5 cm box contains 5 x 5 x 5 = 125 1-cm by 1-cm by 1-cm cubes.
None of the interior cubes touch the box - there are 4 x 4 x 4 = 64 interior cubes.
Also, none of the interior cubes on the top layer touch the box; there are 4 x 4 = 16 of these.
The total number that touch the cardboard is 125 - 64 - 16 = 45 1-cm by 1-cm by 1-cm cubes.