counts the letters in a word and returns count