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