 
#include<stdio.h>
#include<math.h>

int main()
{int st,s,n,i,a,b;
 scanf("%d",&n) ; 
 b=n%10;
 s=b;
 n=n/10;
 st=10;
  for (;n>0;)
 {
  a=n%10;
  n=n/10;
   if (a!=b)
    {
      s=s+st*a;
      st=st*10;
      b=a;
      
    }
    
 }
 
  
 printf("%d",s);
}