x=[0]*8
d={}
for _ in range(int(input())):
    s,c=input().split()
    d[s]=int(c)
for k,v in d.items():
    x[v]+=1
for xx in x:
    print(xx)