Let $k_1="S", k_2="T"$ etc.

If your word starts with $k_1$ there are $\begin{pmatrix}21 \\ k\end{pmatrix}$ length (k+1) words. $0<k\leq 21$

If your word starts with $k_m$ there are $\begin{pmatrix}22-m \\ k\end{pmatrix}$ length (k+1) words. $0<k\leq 22-m$

So you end up with the double summation

$N=\displaystyle{\sum_{m=1}^{22} \sum_{k=0}^{22-m}}\begin{pmatrix}22-m \\ k\end{pmatrix}=4194303$

someone should probably check this.