#include #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n; cin >> n; unordered_map colour_map; rep(i, n) { string s; int c; cin >> s >> c; colour_map[s] = c; } rep(i, 8) { int count = 0; for(auto iter = colour_map.begin(); iter != colour_map.end(); iter++) { if (iter->second == i) { count++; } } cout << count << endl; } }