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