#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n >= 0) {
    cout << n;
    return 0;
  }
  char last[64] = {};
  char prevLast[64] = {};
  sprintf(last, "%d", n);
  size_t len = strlen(last) + 1;
  memcpy(prevLast, last, len);
  last[len - 2] = 0;
  prevLast[len - 3] = prevLast[len - 2];
  prevLast[len - 2] = 0;
  int a = atoi(last);
  int b = atoi(prevLast);
  cout << (a > b ? a : b);
  return 0;
}
