How many positive integers $n$ less than $1000$ have the property that the number of positive integers less than $n$ which are coprime to $n$ is exactly $\tfrac n3$?

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