I am trying to calculate the number of possible substrings with the maximum length n in the dictionary of size $r$. I would think that it should be the number of total subsets (of all sizes) in set of $3$: $2^3=8$ but in the dictionary $\{A,B,C\}$ for example, I've counted $19$:
AAA BBB CCC ABC CBA BCA BAC AA AB AC BB BA BC CC CA CB A B C
Where am I wrong?