#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  if (n >= 0) {
    cout << n << endl;
  } else {
    long long int rLast = n / 10;
    long long int sLast = n % 10 + (n / 100) * 10;
    if (rLast > sLast) {
      cout << rLast << endl;
    } else {
      cout << sLast << endl;
    }
  }
  return 0;
}
