#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  if (a < 0) {
    if (a % 10 < a % 100 / 10)
      cout << (a - a % 10) / 10;
    else
      cout << (a - a % 100 + a % 10 * 10) / 10;
  } else
    cout << a;
}
