#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x, y, z;
  cin >> n;
  z = n;
  if (n >= 0)
    cout << n << endl;
  else {
    x = n % 10 * -1;
    n /= 10;
    y = n % 10 * -1;
    n /= 10;
    if (x == 0 || y == 0)
      cout << n * 10 << endl;
    else if (z < 0 && z >= -10)
      cout << "0" << endl;
    else if (x < y || x == y)
      cout << n * 10 - x << endl;
    else if (x > y)
      cout << n * 10 - y << endl;
  }
  return 0;
}
