#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    if (n >= 0)
      cout << n << endl;
    else if (n > -11)
      cout << 0 << endl;
    else {
      n = -n;
      int a = n % 10;
      int b = n % 100 - a;
      b /= 10;
      if (!(n / 100 == 0 && (a == 0 || b == 0))) cout << '-';
      if (n / 100) cout << n / 100;
      if (a < b)
        cout << a << endl;
      else
        cout << b << endl;
    }
  }
}
