Count the number of words in a text