#include <bits/stdc++.h>
using namespace std;
int main() {
  int c;
  cin >> c;
  if (c >= 0)
    cout << c;
  else if (abs(c) < 100 and abs(c) % 10 == 0)
    cout << 0;
  else {
    int x = abs(c);
    if (x % 10 >= ((x % 100) / 10))
      cout << "-" << x / 10;
    else
      cout << "-" << x / 100 * 10 + x % 10;
  }
  cout << endl;
}
