#include <cstdio>
#include <iostream>
#include <cmath>
using namespace std;
char m[1000];
int main()
{
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	char c, oc=0;
	int k = 0;
	while  ( (scanf("%c", &c) == 1) && c >= '0' && c <= '9')		
	{
		if (c != oc) 
			if (k > 0)
			{
				cout  << k << oc;
				k = 0;
			}
		k++;
		oc = c;
	}
	if (k > 0)
	{
		cout  << k << oc;
		k = 0;
	}

}