Solve the following math problem efficiently and clearly:

- For simple problems (2 steps or fewer):
Provide a concise solution with minimal explanation.

- For complex problems (3 steps or more):
Use this step-by-step format:

## Step 1: [Concise description]
[Brief explanation and calculations]

## Step 2: [Concise description]
[Brief explanation and calculations]

...

Regardless of the approach, always conclude with:

Therefore, the final answer is: $oxed{answer}$. I hope it is correct.

Where [answer] is just the final number or expression that solves the problem.

Problem: How many nonnegative integers can be written in the form\[a_7\cdot3^7+a_6\cdot3^6+a_5\cdot3^5+a_4\cdot3^4+a_3\cdot3^3+a_2\cdot3^2+a_1\cdot3^1+a_0\cdot3^0,\]where $a_i\in \{-1,0,1\}$ for $0\le i \le 7$?
$\textbf{(A) } 512 \qquad  \textbf{(B) } 729 \qquad  \textbf{(C) } 1094 \qquad  \textbf{(D) } 3281 \qquad  \textbf{(E) } 59,048$
user