#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int l = s.length();
  int si = stoi(s);
  if (si > 0)
    cout << s;
  else {
    string s1 = s.substr(0, l - 2);
    if (si != 0 && s[l - 1] >= s[l - 2])
      s1 += s[l - 2];
    else if (si != 0 && s[l - 1] < s[l - 2])
      s1 += s[l - 1];
    if (s1 == "-0")
      cout << "0";
    else
      cout << s1;
  }
}
