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