while True:
try:
string = input()
count = 0
zimu = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in string:
if i in zimu:
count+=1
else:
continue
print(count)
except:
break