while True:
    try:
        a = input()
        n_char = 0
        n_space = 0
        n_digit = 0
        n_other = 0
        for i in a:
            if i.isalpha():
                n_char += 1
            elif i.isnumeric():
                n_digit += 1
            elif i == ' ':
                n_space += 1
            else:
                n_other += 1
        print('%d\n%d\n%d\n%d' % (n_char, n_space,n_digit,n_other))
    except:
        break