#include <cstdio>
#include <iostream>
#include <string.h>
using namespace std;

int main()
{
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	char s[2000]={0};
	int a[2000]={0};
	int i, j, n, kol=0;
	gets(s);
	n = strlen(s);
	for(i=1; i<=n; i++)
		a[i] = s[i-1]-'0';
	i=1;
	while(i<=n)
	{
		if(i!=1 && a[i]!=a[i-1])
		{
			printf("%d", kol);
			printf("%d", a[i-1]);
			kol=1;
		}
		else kol++;
		if(i==n)
			printf("%d%d",kol, a[i]);
		i++;
	}
	return 0;
}