#define loop(i,a,b) for(iny i=a; i<b; ++i)
#define min(a,b) (a)<(b)?a:b;
#define max(a,b) (a)>(b)?a:b;
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int c,n,lc;
int main()
{
	freopen("input.txt","rt",stdin);
	freopen("output.txt","wt",stdout);
	c = 0;
	n = 0;
	c = getchar();
	lc = c;
	n = 1;
	while ( c != EOF )
	{
		c = getchar();
		if ( c == lc )
			++n;
		else
		{
			if ( lc >= '0' && lc <= '9' )
				printf("%d%c",n,lc);
			n = 1;
			lc = c;
		}
	}
	return 0;
}