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

using namespace std;

int main() {
	auto str = "helloWorld"s;
	
	sort(begin(str), end(str));
	
	for(auto start = adjacent_find(cbegin(str), cend(str)), finish = upper_bound(start, cend(str), *start); start != cend(str); start = adjacent_find(finish, cend(str)), finish = upper_bound(start, cend(str), *start)) {
	   cout << *start << " = " << distance(start, finish) << endl;
	}
}