#include <bits/stdc++.h>
using namespace std;
int main() {
  long int num, temp_num;
  int temp2_digits, last, second_last;
  cin >> num;
  if (num >= 0)
    cout << num;
  else {
    num = abs(num);
    temp_num = num / 100;
    temp2_digits = num % 100;
    last = temp2_digits % 10;
    second_last = temp2_digits / 10;
    if (((temp_num * 10) + last) > ((temp_num * 10) + second_last))
      cout << ((temp_num * 10) + second_last) * (-1);
    else
      cout << ((temp_num * 10) + last) * (-1);
  }
  return 0;
}
