#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cstdlib>
#include <cmath>

using namespace std;

int main()
{
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);

	char str[ 10000 ];

	cin >> str;

	int count = 1;
	int curr = str[ 0 ] - '0';
	for (int i = 1; i < strlen(str); i++)
	{
		int k = str[ i ] - '0';
		if (k == curr)
			count++;
		else
		{
			printf("%d%d", count, curr);
			curr = k;
			count = 1;
		}
	}

	printf("%d%d", count, curr);


	fclose(stdin);
	fclose(stdout);
	return 0;
/*
122344111
11111111111
*/
}