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