#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int len;
  cin >> s;
  len = s.size();
  if (s[0] != '-') {
    cout << s << endl;
    return 0;
  }
  if (len == 3) {
    if (s[1] == '0' || s[2] == '0') {
      cout << "0" << endl;
      return 0;
    } else {
      cout << "-";
      int c, d;
      c = s[1] - '0';
      d = s[2] - '0';
      cout << min(c, d) << endl;
    }
  } else {
    int a, b;
    a = s[len - 1] - '0';
    b = s[len - 2] - '0';
    for (int i = 0; i < len - 2; i++) {
      cout << s[i];
    }
    if (a < b)
      cout << a << endl;
    else
      cout << b << endl;
  }
  return 0;
}
