#include <bits/stdc++.h>
using namespace std;
int main() {
  long long tt;
  tt = 1;
  while (tt--) {
    long long n = 0, m = 0, k = 0, x = 0, y = 0, z = 0, i = 0, j = 0;
    string str;
    char c;
    cin >> n;
    if (n >= 0)
      cout << n;
    else {
      n *= (-1);
      str = to_string(n);
      x = str.length() - 1;
      y = str.length() - 2;
      string s;
      if (str[x] > str[y]) {
        for (i = 0; i < str.length(); i++)
          if (i != x) s += str[i];
      } else {
        for (i = 0; i < str.length(); i++)
          if (i != y) s += str[i];
      }
      if (s == "0")
        cout << s;
      else
        cout << '-' << s;
    }
    cout << '\n';
  }
  return 0;
}
