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