#include <stdio.h>
#include <string.h>

int main()
{
	FILE *in;
	FILE *out;
	in=fopen("input.txt", "rt+");
	out=fopen("output.txt", "wt+");
	char txt[1003], txt2[1003], txt3[1003];
	char tem[2];
	int i=0, count=0, flag=0;
	txt2[0]='\0';

	fgets(txt,sizeof(txt),in);
	//printf("!%s",txt);
	tem[0]=txt[0];
	while (txt[i]!='\0')
	{
		if (txt[i]==tem[0])
			count++;
		else
		{
		     if (flag==1)	count++;
		     fprintf(out,"%d",count);
		     flag=1;
		     fprintf(out,"%c",tem[0]);

			tem[0]=txt[i];
			count=0;
		}
		i++;
	}
	fprintf(out,"\n");
	fclose(in);
	fclose(out);
	return 0;
}



