#include<stdio.h>
#include<string.h>
int main(){
int count,i;
char n[1000];
while(scanf("%s",n)!=EOF){
for(i=0;i<strlen(n);i++){
count=1;
while(n[i]==n[i+1]){
i++;
count++;
}
if(count==1)
printf("%c",n[i]);
else if(count==2)
printf("%c%c",n[i],n[i]);
else
printf("%d%c",count,n[i]);
}
printf("\n");
}
}