Count the words in a string.