#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);
}
