#include <stdlib.h>
#include <stdio.h>
//#include <string.h>
//#include <conio.h>

int main(){
  FILE *fl,*fl2;
  char a[1],b[1],s[1500],ch[1],temp[5];
  int count=1;
  //clrscr();
  int i=0;
  for(i=0;i<1500;i++) s[i]=0;
  fl=fopen("input.txt","r");
  fl2=fopen("output.txt","w");
     a[0]=fgetc(fl);
     //fscanf(fl,"%c",&a);
     while (!feof(fl)) {
       b[0]=fgetc(fl);
       //printf("%c\n",b);
       if (a[0]==b[0]) {
	 count++;
       }else {
	ch[0]=a[0];
	fprintf(fl2,"%d%c",count,ch[0]);
	count=1;

	}
	a[0]=b[0];

     }
  fclose(fl);
  fclose(fl2);

  return 0;
}