count_chars_words function

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