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