Count Words in a Line
Count how many words appear in a line of text.
Input format
A single line S of words separated by single spaces.
Output format
Print how many words appear in S.
Constraints
- Values fit in a 64-bit signed integer
- Trailing whitespace and a trailing newline are ignored by the judge
Read from stdin, write to stdout. Sample cases below show the exact format.
Sample cases
Example 1
Input
the sky is blueExpected output
4Example 2
Input
helloExpected output
1