class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); List userName = new List(); List userColor = new List(); for (int i = 0; i < n; i++) { string[] str = Console.ReadLine().Split(' '); if (userName.IndexOf(str[0]) != -1) { userColor[userName.IndexOf(str[0])] = int.Parse(str[1]); } else { userName.Add(str[0]); userColor.Add(int.Parse(str[1])); } } int[] countColor = new int[8]; countColor = UserColorCount(userColor, countColor); foreach(var count in countColor) { Console.WriteLine(count); } } private static int[] UserColorCount(List userColor, int[] countColor) { for(int i = 0; i < userColor.Count; i++) { countColor[userColor[i]]++; } return countColor; } }