import re
s = input()
r = re.findall('[A-Z]', s)
print(len(r))