The function counts the number of characters in a given string.

