while 1: try: string=input() cnt=0 for i in string: if 65<=ord(i)<=90: cnt += 1 print(cnt) except: break