string = input()

cnt = 0
for ch in string:
    if ch.isupper():
        cnt += 1
print(cnt)