#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  if (n > -1) {
    cout << n << endl;
    return 0;
  }
  n = n * (-1);
  int last, before_last;
  last = n % 10;
  before_last = (n / 10) % 10;
  if (last >= before_last) {
    n = n / 10;
    cout << n * (-1) << endl;
  } else {
    n = n / 10;
    n = n / 10;
    n = (n * 10) + last;
    cout << n * (-1) << endl;
  }
  return 0;
}
