#include <iostream>
#include <string.h>
using namespace std;
#define MAX 300
void DemKyTu(char s[]);
int myStrcmp(char s1[MAX], char s2[MAX]);
int myStrlen(char s[], int k);
int main()
{
char s[MAX];
//gets(s); //Nhap chuoi s
cin.getline(s, MAX);
if(myStrcmp(s, "") == 0)
cout << "Chuoi rong." << endl;
else
DemKyTu(s);
return 0;
}
int myStrcmp(char s1[MAX], char s2[MAX])
{
if(s1[0] == s2[0])
return 0;
return 1;
}
void DemKyTu(char s[])
{
int arr[500], cnt[500];
for(int i = 0; i < 500; i++)
arr[i] = 0, cnt[i] = 0;
int i = 0;
while(s[i] != '\0')
arr[int(s[i++])]++;
i = 0;
while(s[i] != '\0')
{
if(cnt[s[i]] > 0)
{
i++;
continue;
}
cnt[s[i]]++;
cout << s[i] << ": " << arr[int(s[i++])] << '\n';
}
}
CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHN0cmluZy5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwojZGVmaW5lIE1BWCAzMDAKCnZvaWQgRGVtS3lUdShjaGFyIHNbXSk7CmludCBteVN0cmNtcChjaGFyIHMxW01BWF0sIGNoYXIgczJbTUFYXSk7CmludCBteVN0cmxlbihjaGFyIHNbXSwgaW50IGspOwoKaW50IG1haW4oKQp7CiAgICBjaGFyIHNbTUFYXTsKICAgIC8vZ2V0cyhzKTsJLy9OaGFwIGNodW9pIHMKICAgIGNpbi5nZXRsaW5lKHMsIE1BWCk7CiAgICBpZihteVN0cmNtcChzLCAiIikgPT0gMCkKICAgICAgICBjb3V0IDw8ICJDaHVvaSByb25nLiIgPDwgZW5kbDsKICAgIGVsc2UKICAgICAgICBEZW1LeVR1KHMpOwogICAgcmV0dXJuIDA7Cn0KCmludCBteVN0cmNtcChjaGFyIHMxW01BWF0sIGNoYXIgczJbTUFYXSkKewogICAgaWYoczFbMF0gPT0gczJbMF0pCiAgICAgICAgcmV0dXJuIDA7CiAgICByZXR1cm4gMTsKfQoKdm9pZCBEZW1LeVR1KGNoYXIgc1tdKQp7CiAgICBpbnQgYXJyWzUwMF0sIGNudFs1MDBdOwogICAgZm9yKGludCBpID0gMDsgaSA8IDUwMDsgaSsrKQogICAgICAgIGFycltpXSA9IDAsIGNudFtpXSA9IDA7CiAgICBpbnQgaSA9IDA7CiAgICB3aGlsZShzW2ldICE9ICdcMCcpCiAgICAgICAgYXJyW2ludChzW2krK10pXSsrOwogICAgaSA9IDA7CiAgICB3aGlsZShzW2ldICE9ICdcMCcpCiAgICB7CiAgICAgICAgaWYoY250W3NbaV1dID4gMCkKICAgICAgICB7CiAgICAgICAgICAgIGkrKzsKICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgfQogICAgICAgIGNudFtzW2ldXSsrOwogICAgICAgIGNvdXQgPDwgc1tpXSA8PCAiOiAiIDw8IGFycltpbnQoc1tpKytdKV0gPDwgJ1xuJzsKICAgIH0KfQoK