#include <stdio.h>
int main()
{
FILE *in,*out;
int i,j;char c[1000],c2;
in=fopen("input.txt","rt");
out=fopen("output.txt","w");
for (i=0,j=1;fread(&c[i],1,1,in);i++)
{
if (i==0) c2=c[0];
else
 {
 if(c2==c[i]) j++;
 else {fprintf(out,"%d%c",j,c2);c2=c[i];j=1;}


 }
}
fprintf(out,"\n");
}