How many small cubes are there which have no coloured faces?
For the sake of simplicity, let’s assume you painted and cut a 4cm×4cm×4cmcube.
Cutting the 4x4x4 cube into 4 cubes would create 64×1×1×1 cubes.
Removing the top and bottom layers of cubes would remove 2cm from the height and make the stack 4×4×2.
Removing the left and right layers of cubes would remove 2 cm from the width and make the stack 4×2×2.
Removing the front and back layers would remove 2 cm from the length and make the stack 2×2×2.
a 2×2×2cube would be made of 8×1×1×1cubes.
So, you would have 8 cubes that are not painted.