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

int n=0, num=0, last=-1;
int main()
{
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	char buf[1000];
	scanf("%s", &buf);
	for(int i=0;i<strlen(buf);i++)
	{
		num=buf[i]-'0';
		if(last==-1)
		{
			last = num;
			n=1;
		}
		else if(num==last)
		{
			n++;
		}
		else
		{
			cout << n << last;
			last=num;
			n=1;
		}
	}
	cout << n << last;
	return 0;
}