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