#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t = 1;
  while (t--) {
    long long int n, m, i, rem = 0, x = 0;
    cin >> n;
    m = n;
    if (n > 0) {
      cout << n << endl;
      break;
    } else {
      rem = n % 10;
      n /= 10;
      x = n % 10;
      if (rem <= x) {
        cout << n << endl;
        break;
      } else {
        n = n / 10;
        n *= 10;
        n += rem;
        cout << n << endl;
        break;
      }
    }
  }
  return 0;
}
