#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a;
  cin >> a;
  long maxN;
  if (a > 0)
    maxN = a;
  else {
    long m1 = a / 10;
    long m2 = a % 10 + a / 100 * 10;
    maxN = max(m1, m2);
  }
  cout << maxN << "\n";
}
