#include <bits/stdc++.h>
using namespace std;
int main() {
  int sum, last, last10;
  bool positive = true;
  cin >> sum;
  if (sum < 0) positive = false;
  if (positive) {
    cout << sum;
    return 0;
  }
  sum = abs(sum);
  last = sum % 10;
  last10 = sum % 100 / 10;
  if (last >= last10) {
    sum -= last;
    sum /= 10;
  } else {
    sum /= 100;
    sum *= 10;
    sum += last;
  }
  if (sum != 0)
    cout << "-" << sum;
  else
    cout << 0;
}
