There is a sequence of words in CamelCase as a string of letters, $\boldsymbol{\mathrm{~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 $\boldsymbol{\mathrm{~S~}}$, determine the number of words in $\boldsymbol{\mathrm{~S~}}$.

Example 

$s=one Two Thee$  

There are $3$ words in the string: 'one', 'Two', 'Three'.  

Function Description

Complete the camelcase function in the editor below.  

camelcase has the following parameter(s):

string s: the string to analyze   

Returns  

int: the number of words in $\boldsymbol{\mathrm{~S~}}$  

Input Format

A single line containing string $\boldsymbol{\mathrm{~S~}}$.

Constraints

$1\leq\text{length of s}\leq10^5$

Sample Input
saveChangesInTheEditor

Sample Output
5

Explanation

String $\boldsymbol{\mathrm{~S~}}$ contains five words:

save
Changes
In
The
Editor

Need help? Try this problem first to get familiar with HackerRank environment.

Difficulty: EASY
Tags: String algorithms

Starter code:

Solutions:
import sys
s = input().strip()
ans = 1
for i in s:
	if i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
		ans += 1
print(ans)


t = input()
uppercase = [x for x in t if x.isupper()]
print(len(uppercase) + 1)


import sys
s = input().strip()
if s == '':
	print(0)
else:
	words = 1
	for char in s:
		if char in 'QWERTYUIOPASDFGHJKLZXCVBNM':
			words += 1
	print(words)


import sys
s = input().strip()
print(1 + sum((1 for c in s if c.isupper())))


import sys
s = input().strip()
res = 0
for i in s:
	if 'A' <= i <= 'Z':
		res += 1
print(res + 1)


import sys
s = input().strip()
print(sum([x in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' for x in s]) + 1)


import sys
import re
s = input().strip()
print(1 + sum((1 for _ in re.finditer('[A-Z]', s))))


import sys
s = input().strip()
count = 0
for ch in s:
	if ch.isupper():
		count += 1
print(count + 1)


import sys
s = input().strip()
c = 0
for a in s:
	if a.isupper():
		c += 1
print(c + 1)


import sys
s = input().strip()
print(len([letter for letter in s if letter if letter == letter.upper()]) + 1)


import sys
s = input().strip()
count = 1
for i in s:
	count += i.isupper()
print(count)


import sys
s = input().strip()
ans = 1
for c in s:
	ans += 'A' <= c <= 'Z'
print(ans)


import sys
s = input().strip()
print(sum((1 for c in s if c.isupper())) + 1)


import sys
s = input().strip()
i = 1
for c in s:
	if c.isupper():
		i += 1
print(i)


import sys
s = input().strip()
cnt = 1
for i in range(len(s)):
	if s[i].isupper():
		cnt += 1
print(cnt)


s = input().strip()
words = 0
if len(s) > 0:
	words += 1
for c in s:
	if c.isupper() == True:
		words += 1
print(words)


import sys
s = input().strip()
count = 1
for letter in s:
	if ord(letter) <= ord('Z'):
		count += 1
print(count)


import sys
cnt = 0
s = input().strip()
l = [i for i in s]
for i in l:
	if i.isupper():
		cnt = cnt + 1
print(cnt + 1)


import sys
s = input().strip()
num = 1
for each in s:
	if each.isupper():
		num += 1
print(num)


import sys
s = input().strip()
res = 1
for c in s:
	if c.isupper():
		res += 1
print(res)


import sys
s = input().strip()
print(sum((ord(i) < 97 for i in s)) + 1)


import sys
s = input().strip()
c = 0
for i in s:
	if 65 <= ord(i) <= 90:
		c += 1
print(c + 1)


s = input()
ans = 0
for c in s:
	if c.isupper():
		ans += 1
print(ans + 1)


import sys
s = input().strip()
c = 0
for i in s:
	if ord(i) < 97:
		c = c + 1
print(c + 1)


import sys
inputValue = input().strip()
counter = 0
for letter in inputValue:
	if letter.upper() == letter:
		counter = counter + 1
print(counter + 1)


s = input()
cnt = 1
for i in range(len(s)):
	if 'A' <= s[i] and s[i] <= 'Z':
		cnt = cnt + 1
print(cnt)


import sys
s = input().strip()
print(1 + len([c for c in s if c in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ']))


import sys
s = input().strip()
if not s:
	print(0)
else:
	count = 1
	for letter in s:
		if letter.isupper():
			count += 1
	print(count)


s = input().strip()
count = 1
for i in range(len(s)):
	if s[i].isupper():
		count += 1
print(count)


import sys
s = input().strip()
res = 0
for c in s:
	if ord('Z') >= ord(c) >= ord('A'):
		res += 1
print(res + 1)


import sys
s = input().strip()
count = 1
for i in s:
	if i.isupper():
		count += 1
print(count)


print(1 + sum((c.isupper() for c in input())))


import sys
s = input().strip()
res = 1
for c in s:
	if c.isupper():
		res += 1
print(res)


s = input()
words = 1
for c in s:
	if c.lower() != c:
		words += 1
print(words)


import sys
s = input().strip()
count = 0
for i in s:
	if ord(i) >= ord('A') and ord(i) <= ord('Z'):
		count += 1
print(count + 1)


import sys
s = input().strip()
words = 1
for i in s:
	if ord(i) < 91:
		words = words + 1
print(words)


import sys
s = input().strip()
c = 1
for i in s[1:]:
	if ord(i) >= 65 and ord(i) <= 90:
		c += 1
print(c)


import sys
s = input().strip()
list1 = [i for i in s if i.isupper()]
print(str(1 + len(list1)))


s = input().strip()
if len(s) > 0:
	count = 1
	for (i, l) in enumerate(s):
		if l.upper() == l:
			count += 1
else:
	count = 0
print(count)


import sys
s = list(input().strip())
uppercase = 0
for letter in s:
	if letter.isupper():
		uppercase += 1
print(uppercase + 1)


import sys
s = input().strip()
c = 0
if s[0].isupper() or s[0].islower():
	c = c + 1
for i in range(1, len(s)):
	if s[i].isupper():
		c = c + 1
print(c)


import sys
s = input().strip()
n = len(s)
count = 1
for i in range(n):
	if ord(s[i]) >= ord('A') and ord(s[i]) <= ord('Z'):
		count += 1
print(count)


c = 1
for i in input():
	c += i.isupper()
print(c)


s = input()
count = 1
for i in s:
	if i == i.upper():
		count += 1
print(count)


import sys
s = input().strip()
c = 0
for i in range(0, len(s)):
	x = ord(s[i])
	if x >= 65 and x < 91:
		c = c + 1
print(c + 1)


import sys
s = input().strip()
test = 0
for c in s:
	if c.isupper():
		test += 1
print(test + 1)


import sys
import re
s = input().strip()
print(len(re.split('[A-Z]', s)))


import sys
s = input().strip()
words = 1
A = ord('A')
Z = ord('Z')
for i in range(len(s)):
	letter = s[i]
	if ord(letter) >= A and ord(letter) <= Z:
		words += 1
print(words)


import sys
i = 1
for c in input():
	if c.isupper():
		i += 1
print(i)


import sys
s = input().strip()
words = 1
for char in s:
	if char == char.upper():
		words += 1
print(words)


import sys
s = input().strip()
ret = 0
for i in s:
	if i.isupper():
		ret += 1
print(ret + 1)


letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
string = input()
ans = 0
for i in string:
	if i in letters:
		ans += 1
print(ans + 1)


import sys
s = input().strip()
cnt = len([x for x in s if x.isupper()])
print(cnt + 1)


s = input().strip()
cnt = 1
for i in range(len(s)):
	if s[i] < 'a':
		cnt += 1
print(cnt)


import sys
s = input().strip()
count = 0
if len(s) > 0:
	count = 1
for char in s:
	if char.isupper():
		count += 1
print(count)


import sys
s = input().strip()
ans = 1
for i in s:
	if ord(i) >= 65 and ord(i) <= 90:
		ans += 1
print(ans)


import sys
s = input().strip()
count = 0
for i in s:
	if ord(i) <= 90 and ord(i) >= 65:
		count += 1
print(count + 1)


import sys
s = input().strip()
print(1 + sum((c == c.upper() for c in s)))


import sys
s = input().strip()
print(len(list(filter(str.isupper, s))) + 1)


import sys
s = input().strip()
print(len([i for i in s if i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ']) + 1)


import sys
LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
a = str(input())
count = 1
for x in a:
	if x in LETTERS:
		count += 1
print(count)


import sys
s = input().strip()
words = 1
for letter in s:
	if letter.isupper():
		words += 1
print(words)


import sys
s = input().strip()
word_count = 0
for c in s:
	if c.isupper():
		word_count += 1
word_count += 1
print(word_count)


import sys
s = input()
count = len(list(filter(str.isupper, s)))
print(count + 1)


import sys
s = input().strip()
upperLetters = []
for i in s:
	if i.isupper():
		upperLetters.append(i)
print(len(upperLetters) + 1)


import sys
s = str(input())
k = 1
if not s:
	print(0)
else:
	for i in range(0, len(s)):
		if ord(s[i]) >= 65 and ord(s[i]) <= 90:
			k += 1
	print(k)


import sys
s = input().strip()
count = 0
if len(s) > 0:
	count += 1
for c in s[1:]:
	if ord(c) >= ord('A') and ord(c) <= ord('Z'):
		count += 1
print(count)


import sys
s = input().strip()
count = 0
if s[0].isupper() == False:
	count = 1
for letter in s:
	if letter.isupper() == True:
		count += 1
print(count)


import sys
s = input().strip()
word = 1
for i in s:
	if i.isupper():
		word += 1
print(word)


import sys
s = input().strip()
chars = list(s)
uppers = 0
for char in chars:
	uppers = uppers + 1 if char.isupper() else uppers
print(str(uppers + 1))


print(len(list(filter(lambda c: c.isupper(), input()))) + 1)


s = input()
index = []
k = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for c in s:
	if c in k:
		index.append(s.index(c))
print(len(index) + 1)


from string import ascii_uppercase as uppers, ascii_lowercase as lowers
S = input().strip()
n = len(S)
answer = 1
for i in range(1, n):
	if S[i] in uppers:
		answer += 1
print(answer)


import sys
s = input().strip()

def count(line):
	num = 0
	for letter in s:
		if letter.isupper():
			num += 1
	return num + 1
print(count(s))


import sys
import re
s = input().strip()
t = re.findall('[A-Z][^A-Z]*', s)
total = 0
if ord(s[0]) > 95:
	total = 1
total = total + len(t)
print(total)


import sys
s = input().strip()
count = 1
for ch in s:
	if ch.isupper():
		count += 1
print(count)


import sys
s = input()
count = 1
for i in s:
	if 91 > ord(i) > 64:
		count += 1
print(count)


import re
s = input('')
k = re.findall('[A-Z][a-z]*', s)
print(len(k) + 1)


print(sum((1 for x in input() if 91 > ord(x) > 64)) + 1)


import sys
s = input().strip()
c = 0
for i in s:
	if i.isupper():
		c = c + 1
c = c + 1
print(c)


import sys
s = input().strip()
wordCount = 0
for i in range(len(s)):
	if ord(s[i]) >= 65 and ord(s[i]) <= 90:
		wordCount += 1
print(wordCount + 1)


import sys
s = input()
i = []
k = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for c in s:
	if c in k:
		i.append(s.index(c))
print(len(i) + 1)


sum = 1
a = input()
for i in range(len(a)):
	if ord(a[i]) >= 65 and ord(a[i]) <= 90:
		sum += 1
print(sum)


import sys
s = input().strip()
c = 1
for i in s:
	if i.isupper():
		c += 1
print(c)


import sys
s = input().strip()
print(sum((1 for c in s if c.isupper())) + 1)


import sys
s = input().strip()
print(len([c for c in s if c < 'a']) + 1)


import sys
s = input().strip()
s = list(s)
sum = 0
for i in range(ord('A'), ord('Z') + 1):
	sum = sum + s.count(chr(i))
print(sum + 1)


import sys
import re
s = input().strip()
result = re.findall('[a-z A-Z][^A-Z]*', s)
print(len(result))


import sys
s = input().strip()
count = 1
for char in s:
	if char.isupper():
		count += 1
print(count)


import sys
s = input().strip()
print(sum([1 for c in s if c.isupper()]) + 1)


import sys
word_count = 1
s = input().strip()
for character in s:
	if character.isupper():
		word_count += 1
print(word_count)


import sys
count = 1
s = input().strip()
for x in s:
	if x.isupper():
		count += 1
print(count)


import sys
s = input().strip()
print(sum((c.isupper() for c in s[1:])) + 1)


import sys
import re
s = input().strip()
p = re.compile('[A-Z][a-z]*')
print(len(p.findall(s)) + 1)


import sys
s = input().strip()
tally = 1
for letter in s:
	if letter == letter.upper():
		tally += 1
print(tally)


import sys
import string
s = input().strip()
d = {c: i for (i, c) in enumerate(string.ascii_uppercase, 1)}
count = 1
sList = list(s)
for i in range(len(sList)):
	for k in d:
		if sList[i] == k:
			count = count + 1
			break
print(count)


import sys
is_Debug_Mode = False
s = input().strip()
print('CamelCase string:{}'.format(s), file=sys.stderr) if is_Debug_Mode else None
print(len([c for c in s if c.isupper()]) + 1)


s = input().strip()
ans = 1
for i in s:
	if 'A' <= i <= 'Z':
		ans += 1
print(ans)


import sys
s = input().strip()
print(1 + len(list(filter(lambda x: ord(x) in range(65, 91), s))))


import sys
s = input().strip()
count = 1
index = 0
while index < len(s):
	if s[index].isupper():
		count = count + 1
	index = index + 1
print(count)