Let $\mathcal{S}$ be a regular 18-gon. For two vertices in $\mathcal{S}$, define the \textit{distance} between them as the length of the shortest path along the edges of $\mathcal{S}$ between them (e.g., adjacent vertices have distance 1). Find the number of ways to choose three distinct vertices from $\mathcal{S}$ such that no two of them have distances 1, 8, or 9.

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