while 1:
    try:
        print([x.isupper() for x in list(input())].count(True))
    except:
        break