#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  if (n >= 0)
    cout << n << "\n";
  else {
    n = (n * (-1));
    long long c = n % 10;
    long long d = n % 100;
    long long p1 = (n - c) / 10;
    long long p2 = ((n - d) / 10) + c;
    p1 *= (-1);
    p2 *= (-1);
    cout << max(p1, p2) << "\n";
  }
  return 0;
}
