#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

int a, n, len;
char s[1005];

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

	int i = 0, j;

	gets(s);
	len = strlen(s);

	while (i < len)
	{
		n = i;
		a = s[i++];
		for (; i < len && s[i] == a; i++);
		printf("%d%d", i - n, a - '0');
	}

	puts("");

	return 0;
}