#include <bits/stdc++.h>
using namespace std;
int main() {
  string in;
  cin >> in;
  if (in[0] != '-') {
    cout << in << endl;
    return 0;
  } else {
    char a, b;
    a = in[(int)in.size() - 1];
    b = in[(int)in.size() - 2];
    if (a < b) {
      in.erase(in.end() - 2);
      if (in[(int)in.size() - 1] == '0' && (int)in.size() == 2)
        cout << "0" << endl;
      else
        cout << in << endl;
      return 0;
    } else {
      in.erase(in.end() - 1);
      if (in[(int)in.size() - 1] == '0' && (int)in.size() == 2)
        cout << "0" << endl;
      else
        cout << in << endl;
      return 0;
    }
  }
}
