Find the smallest positive integer $n$ such that a cube with sides of length $n$ can be divided into exactly 2007 smaller cubes, each with integer side lengths.

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