#include <bits/stdc++.h>
int main() {
  int t, n, m, a, b, p;
  while (~(scanf("%d", &n))) {
    p = 0;
    if (n >= 0)
      printf("%d\n", n);
    else {
      n = -n;
      m = n;
      a = n % 10;
      b = n / 10 % 10;
      while (m != 0) {
        m /= 10;
        p++;
      }
      if (p == 2) {
        if (a == 0) {
          printf("0\n");
          continue;
        } else {
          if (a >= b) {
            printf("-%d\n", b);
            continue;
          }
          if (a < b) {
            printf("-%d\n", a);
            continue;
          }
        }
      } else {
        if (b == 0) {
          printf("-%d\n", n / 10);
          continue;
        } else if (a == 0) {
          printf("-%d%d\n", n / 100, a);
          continue;
        } else {
          if (a >= b) {
            printf("-%d%d\n", n / 100, b);
            continue;
          }
          if (a < b) {
            printf("-%d%d\n", n / 100, a);
            continue;
          }
        }
      }
    }
  }
}
