#include <bits/stdc++.h>
using namespace std;
long long n, i, j, k, temp, count = 0;
int main() {
  int last, second_last, len;
  char balance[15];
  cin >> balance;
  if (balance[0] != '-') {
    printf("%s\n", balance);
  } else if (strlen(balance) == 3 && balance[2] == '0') {
    printf("0\n");
  } else {
    len = strlen(balance);
    for (i = 0; i < len - 2; i++) {
      printf("%c", balance[i]);
    }
    last = balance[len - 1] - '0';
    second_last = balance[len - 2] - '0';
    if (last > second_last) {
      cout << second_last << endl;
    } else {
      cout << last << endl;
    }
  }
  return 0;
}
