big = [chr(i) for i in range(65,91)]#所有大写字母
small =  [chr(i) for i in range(97,123)]#所有小写字母
num = [chr(i) for i in range(48,58)]#所有数字

while True:
    try:
        str = input()
    except:
        break
    else:
        letter = 0
        number = 0
        space = 0
        other = 0
        for i in str:
            if i in big or i in small:
                letter += 1
            elif i in num:
                number += 1
            elif i == ' ':
                space += 1
            else:
                other += 1
                
        print(letter)
        print(space)
        print(number)
        print(other)