#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, c, d;
  cin >> n;
  if (n > 0)
    cout << n << endl;
  else if (n < 0) {
    a = n / 10;
    b = n % 10;
    c = n / 100;
    d = c * 10 + (n % 10);
    if (a > d)
      cout << a << endl;
    else
      cout << d << endl;
  }
  return 0;
}
