#include<stdio.h>

int main(){
  unsigned int n;
  int i,m,r=0,k;
  scanf("%u", &n);
   m=n%10;
  for(i=n-1;i>=0,n=0;i--){
    m=n%10;
    n=n/10;
    k=n%10;
    if(m==k)
      n=n/10;
   
    else r=k*10+m;
  }
  r=n;
  printf("%u", r);
  
  return 0;
}