#include <bits/stdc++.h>
using namespace std;
long long solve() {
  long long n;
  cin >> n;
  if (n >= 0) {
    cout << n;
    return 0;
  }
  n = -n;
  n = min(n / 10, (n / 100) * 10 + n % 10);
  if (n == 0)
    cout << 0;
  else
    cout << "-" << n;
  return 0;
}
signed main() {
  ios::sync_with_stdio(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
