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