#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  if (s.front() != '-')
    cout << s;
  else if (s.size() == 2)
    cout << 0;
  else {
    string a = s.erase(0, 1);
    a.erase(a.size() - 1, 1);
    s.erase(s.size() - 2, 1);
    if (min(a, s) == "0")
      cout << 0;
    else
      cout << '-' << min(a, s);
  }
}
