#include <bits/stdc++.h>
using namespace std;
int main() {
  int state;
  cin >> state;
  int new_state;
  if (state >= 0) {
    new_state = state;
  } else {
    int ult = -1 * state % 10;
    int penult = -1 * state % 100 / 10;
    if (ult >= penult) {
      new_state = state / 10;
    } else {
      if (state / 100 == 0) {
        new_state = ult * -1;
      } else {
        string state_string = to_string(state / 100);
        string ult_string = to_string(ult);
        string con = state_string + ult_string;
        new_state = stoi(con);
      }
    }
  }
  cout << new_state << endl;
}
