CamelCase

November 09, 2017


Alice wrote a sequence of words in CamelCase as a string of letters, s, having the following properties:

It is a concatenation of one or more words consisting of English letters.

All letters in the first word are lowercase.

For each of the subsequent words, the first letter is uppercase and rest of the letters are lowercase.

Given s, print the number of words in s on a new line.

Input Format

A single line containing string s.

Constraints

Output Format

Print the number of words in string s.

Sample Input

saveChangesInTheEditor

Sample Output

5

Explanation

String s contains five words:

save

Changes

In

The

Editor

Thus, we print 5 on a new line.

1
2
3
4
5
6
7
8
9
10
11
import sys

s = input().strip()

count = 1

for ch in s:
    if not ch.islower():
        count += 1
        
print(count)