import re 



def my_func(in_str):
    alphabet = len(re.findall("[a-zA-Z]+?", in_str))
    white_space = len(re.findall("\s", in_str))
    numbers = len(re.findall("\d+?", in_str))
    others = len(in_str) - alphabet - white_space - numbers

    print(alphabet)
    print(white_space)
    print(numbers)
    print(others)


while True:
    try:
        my_func(input())
    except (EOFError, KeyboardInterrupt):
        break