#include <bits/stdc++.h>
using namespace std;
int main() {
  int money, money1, z, x, y;
  while (scanf("%d", &money) != EOF) {
    if (money < 0) {
      x = abs(money) % 10;
      y = abs(money / 10) % 10;
      money1 = money / 100;
      z = min(x, y);
      cout << money1 * 10 - z << endl;
    } else
      cout << money << endl;
  }
  return 0;
}
