string = input()
import re
res = 0
for i in string:
    if re.findall(r'[A-Z]',i):
        res += 1
print(res)