count_chars function

Count the frequency of characters in a string of text x.