// wordcounter.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <string>
#include <iostream>
#include <vector>

using namespace std;

struct Word {
	string spel;
	int count;
};

class Wordlist {
	vector <Word> list;
public:
	void inc(string spel){
		bool isfound = false;
		for(Word *w = list.begin(); w != list.end(); w++){
			if (w->spel == spel){
				w->count++;
				isfound = true;
			}
		}
		if(!isfound){
			Word w;
			w.spel = spel;
			w.count = 1;
			list.push_back(w);
		}
	}
	void output(){
		for(Word *w = list.begin(); w != list.end(); w++){
			cout << w->spel << "," << w->count << endl;
		}
	}
};
string token(string speling){
}
int main(int argc, char* argv[])
{
	string spel;
	Wordlist wl;
	while(!cin.eof()){
		cin >> spel;
		wl.inc(spel);
	}
	wl.output();
	return 0;
}

