88. Word Counter

Acceptance — 0 accepted 0 submissions

Easy
Strings
No companies listed
An essay competition has a word limit. The judges' software must count the words in each line.

Words are separated by one or more spaces. Count the words.

Input Format
A single line. It does not start or end with a space, but there may be several spaces between words.

Output Format
Print the number of words.

Constraints
• 1 ≤ length ≤ 1000
• The line has at least one word.

Example 1

Input
I love coding
Output
3

Explanation Three words.

Example 2

Input
hello    world
Output
2

Explanation Many spaces, but still only two words.

Example 3

Input
BashaByte
Output
1

Explanation A single word.

Acceptance —
Accepted 0
Submissions 0
Auto-save
Saved Ln 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
3
No results yet
Run your code to test it against the sample cases.
Problem List