#include <bits/stdc++.h>
using namespace std;
long long a[40000], u[40000], n, t, i;
int32_t main() {
  long long n;
  cin >> n;
  if (n > 0) {
    cout << n << "\n";
    return 0;
  } else {
    long long first = n / 10;
    long long rem = n % 10;
    n /= 10;
    n /= 10;
    long long second = n * 10 + rem;
    cout << max(first, second) << "\n";
  }
  return 0;
}
