How many of the first $1000$ positive integers can be written as the sum of finitely many distinct numbers from the sequence $3^0$, $3^1$, $3^2$, $\ldots$?

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