A cube of edge $3 \text{ 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, find the value of $N$.

Let's think step by step and output the final answer within \boxed{}.
user