import sys s = input() s = list(s) count = 0 i = 0 while i < len(s): if 65 <= ord(s[i]) <= 90: count += 1 i += 1 print(count)