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