solution to ex5 countingletters