#include <bits/stdc++.h>
int main() {
  long int n, t, te, rm;
  scanf("%ld", &n);
  if (n >= 0)
    printf("%ld", n);
  else {
    rm = abs(n);
    t = rm % 10;
    rm /= 10;
    te = rm % 10;
    rm = rm / 10;
    if (t > te)
      rm = rm * 10 + te;
    else
      rm = rm * 10 + t;
    printf("%ld", (0 - rm));
  }
  return 0;
}
