#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  cin >> s;
  int l = s.size();
  if (s[0] != '-')
    cout << s << endl;
  else if (s[l - 1] < s[l - 2]) {
    int f = 0;
    if (l == 3 && s[2] == '0') {
      s = s.substr(1);
      f = 1;
    }
    cout << s.substr(0, l - 2 - f) + s[l - 1 - f] << endl;
  } else
    cout << s.substr(0, l - 1) << endl;
  return 0;
}
