Graderpractice for programmers

Back to 254275 OOP - Labs 1-5 Review

F. Word count the sequel

Problem

Write a program that reads in many lines of text and counts the number of words and punctuation marks (including: ,.?!). The input ends with the line ***

Examples

Input

Where would you like
to go today?
***

Output

7 words
1 punctuation mark

Input

Today... Well, I need a
coffee and a bar of
chocolate!
***

Output

11 words
5 punctuation marks

Submit your solution

java