#include <iostream>
#include <map>
#include <string>
using namespace std;
int main() {
string s = "ala ma kota";
map<char, size_t> counts;
for (auto& x : s) ++counts[x];
for (auto& x : counts) cout << x.first << " - " << x.second << "\n";
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWFwPgojaW5jbHVkZSA8c3RyaW5nPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBzdHJpbmcgcyA9ICJhbGEgbWEga290YSI7CgltYXA8Y2hhciwgc2l6ZV90PiBjb3VudHM7Cglmb3IgKGF1dG8mIHggOiBzKSArK2NvdW50c1t4XTsKCglmb3IgKGF1dG8mIHggOiBjb3VudHMpIGNvdXQgPDwgeC5maXJzdCA8PCAiIC0gIiA8PCB4LnNlY29uZCA8PCAiXG4iOwp9