#include<iostream>
#include<map>
using namespace std;

int main()
{
	map<string, int> type;
	map<string, int>::iterator it;
	int i;
	string s;

	while (scanf("%d,", &i) != EOF) {
		cin>>s;
		type[s]++;
	}

	for (it = type.begin(); it != type.end(); it++)
		cout<<(*it).second<<endl;

	return 0;
}