#include<stdio.h>
#include<string.h>
#include<memory.h>
#include<math.h>
#include<algorithm>
#include<vector>

using namespace std;

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

	char str[ 2000 ];

	scanf( "%s" , str );

	char cur = 'w';
	int n = strlen( str );
	int count = 0;
	for(int i = 0;i < n;++i)
	{
		if( str[ i ] == cur )
		{
			count++;
			continue;
		}
		if( count )
		{
			printf( "%d%c" , count , cur );
		}
		cur = str[ i ];
		count = 1;
	}

	if( count )
		{
			printf( "%d%c" , count , cur );
		}
	return 0;
}

/*

bool isUsed[ 1005 ];
int Pair[ 1005 ];
bool M[ 1005 ][ 1005 ];

int L , R , Result;
bool DFSL(int);

bool DFSR(int j)
{
	isUsed[ j ] = true;
	if( Pair[ j ] != -1 )
		return DFSL( Pair[ j ] );
	return true;
}

bool DFSL(int i)
{
	for(int j = 0;j < R;++j)
		if( M[ i ][ j ] && !isUsed[ j ] )
			if( DFSR( j ) )
			{
				Pair[ j ] = i;
				return true;
			}
	return false;
}
void pairs()
{
	for(int i = 0;i < L;++i)
	{
		for(int j = 0;j < R + 1;++j)
			isUsed[ j ] = false;
		if( DFSL( i ) )
			++Result;
	}
}
*/

/*
z - 
vector<int> calc_z(const char* s)
{
	vector<int> z;
	int len = strlen( s );
	z.resize( len );
	z[ 0 ] = 0;
	int l = 0 , r = 0;
	int j;
	for(int i = 1;i < len;++i)
		if( i > r )
		{
			for(j = 0;(i + j < len) && (s[ i + j ] == s[ j ]);++j);
			z[ i ] = j;
			l = i;
			r = i + j - 1;
		}
		else
			if( z[ i - l ] < r - i + 1 )
				z[ i ] = z[ i - l ];
			else
			{
				for(j = 1;(i + j < len) && (s[ i + j ] == s[ r - i + j ]);++j);
				z[ i ] = r - i + j;
				l = i;
				r = r + j - 1;
			}
	return z;
}
*/