while True:
try:
strs = input()
englishCount, SpaceCount, NumCount, OtherCount = 0, 0, 0, 0
for x in strs:
if x.isdigit(): # 数字
NumCount += 1
elif x.isupper() or x.islower(): # 大写字母 或 小写字母
englishCount += 1
elif x.isspace(): # 空格
SpaceCount += 1
else: # 其他字符
OtherCount += 1
print(englishCount)
print(SpaceCount)
print(NumCount)
print(OtherCount)
except:
break