get frequency of letters in given input