A metallic solid cuboid of dimensions 36 cm × 18 cm × 12 cm is melted and recast in the form of cubes of side 6 cm. Find the number of cubes so formed.