#include <cstdio>

int main()
{	freopen("input.txt","rt",stdin);
	freopen("output.txt","wt",stdout);


	int res=0;
	char c,t;
	int x;

	scanf("%c",&t);
	while(1)
	{	c=t;
		x=1;
		if(t=='\n') 
		{	printf("%d%d",x,c-'0');
		printf("\n");

			return 0;
		}

		if(scanf("%c",&t)==1)
			while(t==c)
			{
				x++;
				if(scanf("%c",&t)!=1) 
				{	printf("%d%d",x,c-'0');
				printf("\n");
					return 0;
				}
				if(t=='\n') 
				{	printf("%d%d",x,c-'0');
				printf("\n");
					return 0;
				}
				
			}
		else
		{	printf("%d%d",x,c-'0');
			return 0;
		}
		printf("%d%d",x,c-'0');
	}
printf("\n");
	//printf("%d",res);
	return 0;
}