#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n > 0)
    cout << n;
  else {
    int m = n % 10;
    m = m * -1;
    int x = n / 10;
    x = x * -1;
    int p = x % 10;
    if (m < p) {
      m = n + (x * 9) + p;
      cout << m;
    } else {
      p = n + (x * 9) + m;
      cout << p;
    }
  }
  return 0;
}
