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