while True:
try:
import string
s=str(input())
count=0
for i in s:
if i in string.ascii_uppercase:
count+=1
print(count)
except:
break