#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n = 0, a = 0, m = 0, s = 0;
  cin >> n;
  if (n >= 0)
    cout << n;
  else {
    a = abs(n);
    m = a / 10;
    s = m - (m % 10) + (a % 10);
    cout << (-1) * min(m, s);
  }
}
