#include <iostream>
#include <cstdio>
#include <string>
#include <set>
#include <vector>

using namespace std;


int main()
{
	freopen("input.txt", "rt", stdin);
	freopen("outut.txt", "wt", stdout);
	string s;
	cin >> s;
	int count=1;
	char prev=s[0];
	for(int i=1; i<s.length(); i++)
	{
		if(prev == s[i])
			count++;
		else
		{
			cout << count << prev;
			prev=s[i];
			count=1;
		}
	}
	cout << count << prev;


	return 0;
}
