#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, i;
  cin >> n;
  if (n >= 0)
    cout << n;
  else {
    n = abs(n);
    k = n / 10;
    i = (n / 100) * 10 + n % 10;
    if (k == 0 || i == 0) {
      cout << 0;
      return 0;
    }
    if (k <= i && k != 0 && i != 0)
      cout << -1 * k;
    else
      cout << -1 * i;
  }
}
