def count_characters(s):
    # 初始化计数器
    count_letter = 0
    count_space = 0
    count_digit = 0
    count_other = 0

    # 遍历字符串中的每个字符,统计各类字符的个数
    for c in s:
        if c.isalpha():
            count_letter += 1
        elif c.isspace():
            count_space += 1
        elif c.isdigit():
            count_digit += 1
        else:
            count_other += 1

    # 返回统计结果
    return count_letter, count_space, count_digit, count_other

# 示例
s = str(input())
letter_count, space_count, digit_count, other_count = count_characters(s)
print(f"{letter_count}")
print(f"{space_count}")
print(f"{digit_count}")
print(f"{other_count}")