#include <iostream>
#include <unordered_map>
#include <map>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
//堆
// struct Compare
// {
// bool operator()(const pair<string,int>& p1,const pair<string,int>& p2)
// {
// if(p1.second != p2.second)
// {
// return p1.second < p2.second;
// }
// else
// {
// return p1.first > p2.first;
// }
// }
// };
// int main() {
// string s;
// unordered_map<string,int> umap;
// while(getline(cin,s))
// {
// string temp;
// for(int i = 0; i < s.size(); i++)
// {
// if(s[i] == ' ' || s[i] == '.')
// {
// if(temp != "")
// umap[temp]++;
// temp = "";
// }
// else
// {
// temp+=tolower(s[i]);
// }
// }
// }
// priority_queue<pair<string,int>,vector<pair<string,int>>,Compare> pq;
// for(auto& e : umap)
// {
// pq.push(e);
// }
// while(!pq.empty())
// {
// auto e = pq.top();
// cout << e.first << ":" << e.second << endl;
// pq.pop();
// }
// }
//sort
struct Compare
{
bool operator()(const pair<string,int>& p1,const pair<string,int>& p2)
{
return p1.second > p2.second;
}
};
int main() {
string s;
map<string,int> map;
while(getline(cin,s))
{
string temp;
for(int i = 0; i < s.size(); i++)
{
if(s[i] == ' ' || s[i] == '.')
{
if(temp != "")
map[temp]++;
temp = "";
}
else
{
temp+=tolower(s[i]);
}
}
}
vector<pair<string,int>> v(map.begin(),map.end());
sort(v.begin(),v.end(),Compare());
for(auto& e : v)
{
cout << e.first << ":" << e.second << endl;
}
}