#include<stdio.h>

int main()
{
  unsigned int n;
  int d, c, s;

  scanf("%d \n", &n);

  while(n!=0)
    {
      d = n%10;
      n = n/10;
      c = n%10;
    }
  if(c=d)
    s = d;

  printf("%d\n", &s);
  return 0;
}
