Say that a string of letter a, b and c is called special if all maximal substrings formed by consecutive letters b have even length, and if all maximal substrings formed by consecutive letters c have even length. For example, the strings abbcc or abbbbacc are special but the string ababcc is not.
Let $A_n$ be the number of special substrings of length n. Find the recursive formula $A_n$ in terms of $A_{n-1}$ and $A_{n-2}$.
Hint:
Every special word ends with either at least one $a$, or ends with at least two $b$'s, or ends with at least two $c$'s.