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