Think about 1 dimension first, if you have a 10 cm line drawn, you can place 5 wooden cubes on that line. Now let's move on to 2 dimensions, you can place 5*5 cubes on a 10 by 10 square, i.e you can place 25 cubes on a 10 by 10 square. move on to 3 dimensions. you just have to multiply your previous answer with 5.
i.e 5*5*5 = 125 cubes