#include <iostream>
#include <string>
#include <algorithm>

int main(){
    std::string str = "the quick brown fox jumps over the lazy dog";
    std::sort(str.begin(), str.end());
    std::string strcopy;
    std::unique_copy(str.begin(), str.end(), back_inserter(strcopy) );
    for(size_t i=0; i<strcopy.length(); ++i)
	std::cout << strcopy[i] << " = " <<  count(str.begin(), str.end(), strcopy[i]) << "\n";
}
