SDE Path

Count Spaces in a Line

Easy

Count Spaces in a Line

Count the space characters in a line of text.

Input format

A single line S of words separated by single spaces.

Output format

Print how many space characters 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 blue
Expected output
3
Example 2
Input
hello
Expected output
0