import std.algorithm;
import std.array;
import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main() {
    //stdin.open("input.txt", "r");
    //stdout.open("output.txt", "w");
    string num = strip(readln());
    if (num[0] == '-') {
        int a = to!int(num[0..$-1]);
        int b = to!int(num[0..$-2] ~ num[$-1..$]);
        writeln(a > b ? a : b);
    } else {
        writeln(num);
    }
}