#include <bits/stdc++.h>
using namespace std;
int main() {
  string n;
  cin >> n;
  if (n[0] != '-') {
    cout << n;
  } else {
    char max = '0';
    int mem;
    for (int i = n.length() - 2; i < n.length(); ++i) {
      if (n[i] >= max) {
        max = n[i];
        mem = i;
      }
    }
    string merge = n.substr(0, mem) + n.substr(mem + 1, n.length());
    int result = atoi(merge.c_str());
    cout << result;
  }
  return 0;
}
