stri = input()

counter = 0
for i in stri:
    if 'A' <= i <= 'Z':  # python 可以直接链式比较,即中间不需要and,要注意<和>的方向
        counter += 1

print(counter)