A cube of edge 3 cm is cut into N smaller cubes, not all the same size. If the edge of each of the smaller cubes is a whole number of centimeters, then what is the value of N?