#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
int  main(){
FILE *f,*f1;
int A[100];
int B[100];
char c,c0,c1,i,j,k=0;
char filename[10]="input.txt",filename1[11]="output.txt";
f=fopen(filename,"r");
f1=fopen(filename1,"w");
fscanf(f,"%c",&c0);
while(!feof(f)){
fscanf(f,"%c",&c);
c1=c;
if (c0==c1) k++;
if (c0!=c1) {fprintf(f1,"%d%c",k,c);k=0;}
c0=c1;

printf("%c",c); }
fclose(f);



return 0;
}