#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n >= 0)
    cout << n << endl;
  else {
    n = -1 * n;
    int o = n % 10;
    cout << -1 * (min(n / 10, (n / 100) * 10 + o)) << endl;
  }
}
