import string
str1 = string.ascii_letters
str2 = '1 2 3 4 5 6 7 8 9 0'

while True:
    try:
        #获取输入数据
        x1 = input()
        #设置英文字符、空格、数字以及其他字符初值
        n1 = 0
        n2 = 0
        n3 = 0
        n4 = 0
        
        for word in x1:
            if word in str1:
                n1 = n1 + 1
            elif word == ' ':
                n2 = n2 + 1
            elif word in str2:
                n3 = n3 + 1
            else:
                n4 = n4 + 1
        
        print(n1)
        print(n2)
        print(n3)
        print(n4)
        
    except:
        break