#83Easy
Word count
Time: 1 s · Memory: 256 MB
- Strings
Statement
You are given a string. Find the number of words in it. A word is a continuous sequence of non-space characters. Words may be separated by several spaces, and there may be spaces at the start and the end of the line.
Input format
A single line — a string of to ASCII characters (codes –: letters, digits, punctuation and spaces). There is at least one word.
Output format
A single integer — the number of words.
Examples
Input
Assalomu alaykum aziz do'stlar
Output
4
Input
bir ikki
Output
2
Note
Counting spaces is not enough: bir ikki has many spaces but only two words. Count word starts — a non-space character preceded by a space (or by the start of the line). In Python — len(s.split()).
