while True:
try:
strs = input()
if 1 <= len(strs) <= 250:
List = []
for x in strs:
if x.isupper(): # 判断是否大写字母
List.append(x)
print(len(List))
except:
break