We’re preparing your current view and syncing the latest data.
Ilya has a bank account with a balance represented as an integer n, which can be negative. To increase the balance, Ilya can remove exactly one digit from the decimal representation of n (except the minus sign). Write a program that determines the maximum possible balance after removing one digit.
The input consists of a single integer n (-10^9 ≤ n ≤ 10^9), representing the bank account balance.
Output the maximum possible balance after removing exactly one digit from n.
The integer n can be negative or positive. Only one digit can be removed, and if n is positive, removing a digit might decrease the value, so removal is allowed regardless of sign.
Example 1
Input
-100
Output
-10
Explanation
Removing one zero from '-100' results in '-10' which is greater than '-100' or '-1'.
Example 2
Input
10
Output
1
Explanation
Removing '0' from '10' results in '1' which is less than '10', but removal is allowed.