法一 用isupper()函数
while True:
try:
s=input()
res=0
for i in s:
if i.isupper():
res+=1
print(res)
except:
break
'''
#法二 用字符串的比大小!>='A' <='Z'
while True:
try:
n = input()
result = 0
for i in n:
if i >= 'A' and i <= 'Z':
result += 1
print(result)
except:
break
法三:用ord() ASCll表 <91 and ord(i)>64
while True:
try:
s = input()
n=0
for i in s:
if ord(i)<91 and ord(i)>64:
n=n+1
print(n)
except:
break
'''