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