while True:
try:
s = input()
isal = 0
issp = 0
isdi = 0
other = 0
for i in s:
if i.isalpha():
isal+=1
elif i.isspace():
issp+=1
elif i.isdigit():
isdi+=1
else:
other+=1
print(isal,issp,isdi,other,sep='\n')
except:
break