#include <bits/stdc++.h>
using namespace std;
int main() {
  stringstream s1, s2;
  string y1, y2;
  int x1, x0, x2, min1;
  cin >> x0;
  if (x0 >= 0) {
    cout << x0;
  } else {
    s1 << x0;
    s1 >> y1;
    s1.clear();
    y1.erase(y1.size() - 1);
    s1 << y1;
    s1 >> x1;
    s1.clear();
    if (x1 > x0) {
      min1 = x1;
    }
    s2 << x0;
    s2 >> y2;
    s2.clear();
    y2.erase(y2.end() - 2);
    s2 << y2;
    s2 >> x2;
    s2.clear();
    if (x2 > x0 && x2 > x1 && y2.size() != 1) {
      min1 = x2;
    }
    cout << min1;
  }
  return 0;
}
