#include <bits/stdc++.h>
int main() {
  std::string s;
  std::cin >> s;
  if (s[0] != '-') {
    std::cout << s << std::endl;
    return 0;
  }
  s.erase(*s.rbegin() > *(s.rbegin() + 1) ? s.end() - 1 : s.end() - 2);
  if (s == "-0") {
    s = "0";
  }
  std::cout << s << std::endl;
  return 0;
}
