The Total Volume is V= 8x6x18 = 864 units³ , Or 864 sugar cubes.
If we calculate V₁, the volume (or number of sugar cubes) that DOESN'T touch the sides of the box, then: V-V₁ = will give the volume (or the Cube number) of those who touch the box.
The following is in respect of the cubes that DO NOT touch the box:
The Length = 8, (or 8 cubes), becomes 6 (or 6 cubes), because already
1 is touching at the right and another is touching at the left.
The Width = 6 , (or 6 cubes), becomes 4 (or 4 cubes), because already
1 is touching at the right and another is touching at the left.
Same for the height = 18, it becomes 18-2 = 16, hence volume of the cubes that DON'T touch the box = V₁ = (8-2)(6-2)(18-2) = 384 Sugar cube
Then V-V₁ = 864 - 384 = 480 sugar cubes that TOUCH the box