#include <bits/stdc++.h>
using namespace std;
int main() {
  long long num, a, b;
  cin >> num;
  if (num >= 0) cout << num << endl;
  if (num < 0) {
    num = num * -1;
    int a = num % 10;
    num = num / 10;
    int b = num % 10;
    num = num / 10;
    if (num == 0) {
      if (a == 0 || b == 0)
        cout << "0" << endl;
      else
        cout << min(a, b) * -1 << endl;
    } else {
      cout << num * -1 << min(a, b) << endl;
    }
  }
  return 0;
}
