#include <bits/stdc++.h>
int main() {
  int n, n1, x, x1;
  scanf("%i", &n);
  n1 = n;
  if (n > 0)
    printf("%i", n);
  else {
    x = n1 / 100;
    x = x * 10 + n % 10;
    x1 = n1 / 10;
    if (x > x1)
      printf("%i", x);
    else
      printf("%i", x1);
  }
  return 0;
}
