#include <iostream>
#include <string>
#include <cctype>
#include <map>
using namespace std;
void count_occurances( const string& the_line)
{
map< char , unsigned > counts;
for ( char c: the_line)
if ( isalpha ( c) )
++ counts[ toupper ( c) ] ;
for ( const auto & p: counts)
cout << char ( tolower ( p.first ) ) << " or " << p.first << " occurred: "
<< p.second << " times\n " ;
}
int main( )
{
cout << "Enter line\n "
">>" ;
string line;
getline( cin , line) ;
count_occurances( line) ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8Y2N0eXBlPgojaW5jbHVkZSA8bWFwPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnZvaWQgY291bnRfb2NjdXJhbmNlcyhjb25zdCBzdHJpbmcmIHRoZV9saW5lKQp7CiAgICBtYXA8Y2hhciwgdW5zaWduZWQ+IGNvdW50czsKCiAgICBmb3IoY2hhciBjOiB0aGVfbGluZSkKICAgICAgICBpZihpc2FscGhhKGMpKQogICAgICAgICAgICArK2NvdW50c1t0b3VwcGVyKGMpXTsKCiAgICBmb3IoY29uc3QgYXV0byYgcDogY291bnRzKQogICAgICAgIGNvdXQgPDwgY2hhcih0b2xvd2VyKHAuZmlyc3QpKSA8PCAiIG9yICIgPDwgcC5maXJzdCA8PCAiIG9jY3VycmVkOiAiCiAgICAgICAgICAgICA8PCBwLnNlY29uZCA8PCAiIHRpbWVzXG4iOwp9CgppbnQgbWFpbigpCnsKICAgIGNvdXQgPDwgIkVudGVyIGxpbmVcbiIKICAgICAgICAgICAgIj4+IjsKICAgIHN0cmluZyBsaW5lOwogICAgZ2V0bGluZShjaW4sIGxpbmUpOwoKICAgIGNvdW50X29jY3VyYW5jZXMobGluZSk7Cn0K