find the frequency of each letter in a string