Edit: Rewriting the post to give a more concrete explanation.
There is an idea in martingale theory to find the expectation of a stopping time by using a betting martingale with mean $0$ difference. Suppose we have a series of people coming in, each right before a coin flip, who bet $1$ dollar on the outcome of the flip. If they win, they end up with $1$ dollar, if they lose, they end up with $-1$ and stay that way forever. Next, if they win again, they double the bet, and continue until they have completely won (our condition has been met). To formalize this, let $Z_{k,n}$ be the winnings of better $k$ at time $n$. Note that $Z_{k,k} = 2-1$ if we get heads on flip $k$, and $Z_{k,k} = -1$ if we get tails on flip $k$. Then, for $i > j > k$, if $Z_{k,j} = -1$, $Z_{k,i} = -1$ as well, i.e. they stay broke and cant bet anymore. Also, if they win three times in a row (HTH) then they stop betting completely. Define $S_n = \sum_{k=1}^n Z_{k,n}$. Note that $\mathbb E[Z_{k,j + 1} \mid Z_{k,j}] = Z_{k,j}$, so $S_n$ is a martingale. Now let $T$ be the first time at which we have finished seeing $3$ HTH sequences. It is not hard to check that $T$ is a stopping time, which means by the optional stopping theorem $$0 =\mathbb E[S_0] = \mathbb E[S_T] = \mathbb E[8 + 8 + 8 + 2 - T] \iff \mathbb E[T] = 26$$ Note that we get $8 + 8 + 8 + 2$ since three betters will have made $8$, and the last flip will have made an extra $2$. And the $-T$ is by design since every $Z_{k,n}$ has a $-1$ attached to it (the first win is $2-1$, then $4-1$, then $8-1$), hence $S_T$ has a $-T$ as well as $8,8,8,2$ in winnings.
The benefit of this method is that it is very versatile. You can use this to easily find any other string of sequences, or the expected amount of time before an infinite number of monkeys type a word (You should replace the bet of $2$ with the bet of $26$), or any expected time really. Take, for instance, HHHHH like another commenter pointed out. We don’t need to do any more complicated math since $$\mathbb E[ 2^5 + 2^4 + 2^3 + 2^2 + 2 - T] = 0$$ using the same design as before.