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

int main(){
  FILE *fl,*fl2;
  char a[1001],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");
    fscanf(fl,"%s",&a);
    printf("\n\n%s\n",a);
  fclose(fl);
  fl2=fopen("output.txt","w");
  ch[0]=a[0];
  for(i=0;i<strlen(a);i++){
    //printf("%c",a[i]);
    if (a[i]==a[i+1]) {
      count++;
    } else {
      itoa(count,temp,10);
      ch[0]=a[i];
      fprintf(fl2,"%s%c",temp,ch[0]);
      //strcat(s,temp);

      //printf("%s  %c\n",temp,ch[0]);
      //strcat(s,ch);
      count=1;

    }
      //	printf("%s\n",s);
  }
  fclose(fl2);
  //printf("%s",s);
  //getch();
  return 0;
}