str1 = input()
p = 0
j = 0
k = 0
other = 0
for i in str1:
    if 65 <= ord(i) <= 90 or 97 <= ord(i) <= 122:
        p += 1
    elif i == ' ':
        j += 1
    elif 48 <= ord(i) <= 57:
        k += 1
    else:
        other += 1
print(p)
print(j)
print(k)
print(other)