#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC optimize("no-stack-protector,fast-math")
using namespace std;
double PI = 3.1415926535897;
const int N = 1e5 + 5, M = 1e2 + 5, MOD = 1e9 + 7, inf = 0x3f3f3f3f;
int n;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  cin >> n;
  if (n > 0)
    cout << n;
  else {
    int l = n % 10;
    n /= 10;
    int ans1 = n;
    int bl = n % 10;
    int ans2 = (n / 10) * 10 + l;
    printf("%d", max(ans1, ans2));
  }
  return 0;
}
