For each positive integer $n$, let $S(n)$ denote the sum of the digits of $n$. Determine how many values of $n$ satisfy the equation \( n + S(n) + S(S(n)) = 2007 \).

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