#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  if (s[0] != '-') {
    cout << s << endl;
    return 0;
  }
  int pos;
  int len = (int)s.length();
  if (s[len - 1] > s[len - 2])
    pos = len - 1;
  else
    pos = len - 2;
  if (pos != 1 || s[pos + 1] != '0') cout << s[0];
  for (int i = 1; i < len; i++)
    if (i != pos) cout << s[i];
  cout << endl;
  return 0;
}
