#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long n;
  cin >> n;
  if (n >= 0)
    cout << n << endl;
  else {
    long long a = n;
    a /= 10;
    long long b = n;
    int d = b % 10;
    b /= 10;
    b /= 10;
    b = (b * 10) + d;
    long long c = max(a, b);
    cout << c << endl;
  }
  return 0;
}
