while True: try: s = input() num = 0 l = [ord(i) for i in s] for j in l: if 65<=j<=90: num+=1 print(num) except: break