python 正则表达式 一行代码

import re
while True:
    try:
        print(len(re.findall(r'[A-Z]', input())))
    except:
        break