#include <iostream>
#include <fstream>
#include <string.h>

using namespace std;

int main()
{
	ifstream input("input.txt", ios::in);
	ofstream output("output.txt", ios::out);
	
	char str[1000];
	memset(str, 0, 100000);
	
	char result[100000];
	memset(result, 0, 100000);
	int k = 0;

	input >> str;
	
	bool test = false;
	char cur = 0;
	int cnt = 0;

	int len = strlen(str);
	for (int i = 0; i < len; i++)
	{
		if (!test)
		{
			test = true;
			cur = str[i];
			cnt = 1;
		}
		else
		{
			if (cur == str[i])
				cnt++;
			else
			{
				output << cnt << cur;
				cur = str[i];
				cnt = 1;
			}
		}
	}
	output << cnt << cur;

	
	//printf("%.2f", result / cnt);
	//cout << result / cnt << endl;
	//cout.setf(ios::showpoint | ios::fixed);
	//cout.precision(2);
	//cout << (float)(result / cnt);

	//output.setf(ios::showpoint | ios::fixed);
	//output.precision(2);
	//output << result / cnt;
	//cin.get();
	return 0;
}