Let m denote the length of the string s.
Note that typos of different types produce words with different number of letters, so it's enough the number of possible words that may occur from each type separately, and then add them.
For type 3 it'