Words in Sentence

Beginner

Given a sentence, find out the no. of words in the sentence. You can assume that there are no whitespaces before the first word and after the last word in the sentence.

This problem requires you to read line-by-line instead of word-by-word which is the default behavior in most languages.
Google "read line in C++". Replace C++ with the language that you are using.

Input Format

A single sentence

Output Format

The no. of words in the sentence

Examples

Sample Input

The quick brown fox jumped over the lazy dog.

Expected Output

9

Constraints

0 < length of sentence <= 100000

Companies
Editorial Link: Editorial