#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Assoc
{
struct Pair
{
string name;
double val;
Pair(string n = "", double v = 0):name(n),val(v){}
};
vector<Pair> vec;
Assoc(const Assoc&); //私用,防止复制
Assoc& operator=(const Assoc&); //私用,防止复制
public:
Assoc(){}
const double & operator[] (const string&);
double& operator[](string&);
void pring_all()const;
};
/**************************************************************
在assoc里保存着一个pair的向量。
***************************************************************/
double& Assoc::operator[](string& s)
{
//检索s; 如果找到就返回其值;否则做一个新的Pair并返回默认值0
for(vector<Pair>::iterator p = vec.begin();p != vec.end();++p)
if(s == p->name) return p->val;
vec.push_back(Pair(s,0));
return vec.back().val;
}
void Assoc::pring_all() const
{
for(vector<Pair>::const_iterator p = vec.begin();p!=vec.end();++p)
cout << p->name << ":" << p->val << '\n';
}
int main()
{
string buf;
Assoc vec;
while(cin>>buf) vec[buf]++;
vec.pring_all(); //输入结束.ctrl+z
return 0;
}