Let an be a sequence such that $a_0 = 0$ and:
$a_{3n+1} = a_{3n} + 1 = a_n + 1$
$a_{3n+2} = a_{3n} + 2 = a_n + 2$
for all natural numbers $n$. How many $n$ less than $2012$ have the property that $a_n = 7$?

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