Count the number of characters.