#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
int  main(){  printf("\n");
FILE *f,*f1;
char c,c0,c1;int i,j=0,k=0;
char filename[10]="input.txt",filename1[11]="output.txt";
f=fopen(filename,"r");
f1=fopen(filename1,"w+");
fscanf(f,"%c",&c0);
//fscanf(f,"%c",&c1);
//if (c0>='0'&&c0<='9'&&c1>='0'&&c1<='9') {
//fseek(f,0,0);


//fscanf(f,"%c",&c0);
printf("!%c!",c0);
if (!feof(f))
	{
	while(!feof(f))
		{


	fscanf(f,"%c",&c);printf("%c",c);
	c1=c;
	if (c0==c1) {k++;}
	if (c0!=c1) {fprintf(f1,"%d%c",k+1,c0);k=0;j++;}
	c0=c;

		 }
       fprintf(f1,"%d%c",k,c0);j++;	}

 else
 if (c0>='0'&&c0<='9') fprintf(f1,"1%c",c0);
//else
// fprintf(f1,"00");
fclose(f1);
fclose(f);




return 0;
}