s = input() start = ord('A') end = ord('Z') n = 0 for i in s: if start <= ord(i) <= end: n += 1 print(n)