#include using namespace std; int main() { int n; cin >> n; vector cnt(8, 0); map col; while (n--) { string s; int c; cin >> s >> c; if (col.count(s)) { cnt[col[s]]--; } col[s] = c; cnt[col[s]]++; } for (int x : cnt) cout << x << endl; }