DWITE Online Computer Programming Contest


December 2008
Problem 2

There’s an essay due in class, and your teacher demands at least a certain minimum length for your paper. Caring more about optimization than the subject of ancient history, a word count tool would come in handy and save you from writing any more words than you need to.

Knowing that your teacher counts only the words that are more than three letters long (having a similar software tool of her own), your program would need to do just that – count the words that are at least 4 letters long.

The input file DATA2.txt will contain 5 lines, each a line of English text, no more than 255 characters in length.

The output file OUT2.txt will contain 5 integer values – the count of words over 3 letters long, in each line.

Sample Input:
DWITE question number two: Wordcount++
Note how "two:" does not count.
For simplicity - "don't" is two words, split by apostrophe.

That was a blank line above.
Sample Output: