#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v;
  long long n, num, max;
  cin >> n;
  max = n;
  if (n < 0)
    num = n * (-1);
  else
    num = n;
  while (num != 0) {
    v.push_back(num % 10);
    num /= 10;
  }
  for (int i = 0; i < 2; i++) {
    long long number = 0;
    for (int j = 0; j < v.size(); j++) {
      if (i == j) continue;
      long long divisor = 1;
      for (int k = 0; k < j - 1; k++) divisor *= 10;
      number += v[j] * divisor;
    }
    if (n < 0) {
      if (number * -1 > max) max = number * -1;
    } else if (number > max)
      max = number;
  }
  cout << max;
  return 0;
}
