#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  if (s[0] == '-') {
    string s1, s2;
    s1 = s2 = s;
    string::iterator it = s.end();
    s1.erase(s1.end() - 1);
    s2.erase(s2.end() - 2);
    s = min(s1, s2);
    if (s[1] == '0' && s.size() == 2)
      cout << 0;
    else
      cout << s;
  } else
    cout << s;
  return 0;
}
