N = int(input()) coders = {} for i in range(N): inputSC = input() spritSC = inputSC.split() S = spritSC[0] C = int(spritSC[1]) coders[S] = C for i in range(8): coder = 0 for value in coders.values(): if value == i: coder += 1 print(coder)