read and count words in a text

read and count words in a single line of text