#include <stdio.h>

int main () {
  
unsigned int n, m;
int i;
scanf("%u", &n);

for(i=0;i<10;i++){
  while(n>0){
    if(n%10==i && n%100==i){
    
      m=n/10;
    }
      n=n/100;
   
  }
}
  
printf("%u\n", m);
  
  
return 0;
}
