#include <stdio.h>
void stringZip(const char
*pInputStr, long lInputLen, char *pOutputStr)
{ int n=1;
char c,*p1=pInputStr,*p2=pOutputStr; while(*p1) {c=*(p1++);
while(*p1==c){n++;p1++;}
if(n>1)
{
if(n>999){*(p2++)=48+n/1000; n/=10;}
if(n>99){*(p2++)=48+n/100; n/=10;}
if(n>9){*(p2++)=48+n/10; n/=10;}
*(p2++)=48+n;
}
*(p2++)=c;
n=1;
} *p2='\0';}
void main()
{ char s1[200],s2[200];
gets(s1); stringZip(s1,strlen(s1),s2); puts(s2);}