#include <iostream>
#include <map>
#include <cstring>
#include <cstdlib>
using namespace std;
int main() {
map<string, int> m;
string word;
while( cin >> word )
m[word]++;
for(map<string, int>::iterator (it) = (m).begin(); (it) != (m).end() ; (it)++)
{
cout<<it->first<<" - "<<it->second<<endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWFwPgojaW5jbHVkZSA8Y3N0cmluZz4KI2luY2x1ZGUgPGNzdGRsaWI+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCW1hcDxzdHJpbmcsIGludD4gbTsKCXN0cmluZyB3b3JkOwoJCgl3aGlsZSggY2luID4+IHdvcmQgKQoJCW1bd29yZF0rKzsKCWZvcihtYXA8c3RyaW5nLCBpbnQ+OjppdGVyYXRvciAoaXQpID0gKG0pLmJlZ2luKCk7IChpdCkgIT0gKG0pLmVuZCgpIDsgKGl0KSsrKQoJewoJCWNvdXQ8PGl0LT5maXJzdDw8IiAtICI8PGl0LT5zZWNvbmQ8PGVuZGw7Cgl9CglyZXR1cm4gMDsKfQ==