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