#include <bits/stdc++.h>
struct str {
  int x;
  int y;
};
bool my(str lhs, str rhs) { return lhs.x < rhs.x; }
using namespace std;
int main() {
  long long int x, a, b;
  cin >> x;
  if (x > 0)
    cout << x;
  else {
    x = x * (-1);
    a = x % 10;
    b = (x % 100) / 10;
    x = x / 100;
    if (a > b)
      x = x * 10 + b;
    else
      x = x * 10 + a;
    x = x * (-1);
    cout << x;
  }
  return 0;
}
