Ilya is a very clever lion, he lives in an unusual city ZooVille. In this city all the animals have their rights and obligations. Moreover, they even have their own bank accounts. The state of a bank account is an integer. The state of a bank account can be a negative number. This means that the owner of the account owes the bank money.

Ilya the Lion has recently had a birthday, so he got a lot of gifts. One of them (the gift of the main ZooVille bank) is the opportunity to delete the last digit or the digit before last from the state of his bank account no more than once. For example, if the state of Ilya's bank account is -123, then Ilya can delete the last digit and get his account balance equal to -12, also he can remove its digit before last and get the account balance equal to -13. Of course, Ilya is permitted not to use the opportunity to delete a digit from the balance.

Ilya is not very good at math, and that's why he asks you to help him maximize his bank account. Find the maximum state of the bank account that can be obtained using the bank's gift.


-----Input-----

The single line contains integer n (10 ≤ |n| ≤ 10^9) — the state of Ilya's bank account.


-----Output-----

In a single line print an integer — the maximum state of the bank account that Ilya can get. 


-----Examples-----
Input
2230

Output
2230

Input
-10

Output
0

Input
-100003

Output
-10000



-----Note-----

In the first test sample Ilya doesn't profit from using the present.

In the second test sample you can delete digit 1 and get the state of the account equal to 0.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
if n >= 0:
    print(n)
else:
    n = str(n)
    print(max(int(n[:-1]), int(n[:-2] + n[-1])))


n = int(input())
if n >= 0:
    print(n)
else:
    n1 = list(str(n))
    n1.pop(len(n1)-1)
    n1 = int(''.join(n1))
    n2 = list(str(n))
    n2.pop(len(n2)-2);
    n2 = int(''.join(n2))
    print(max(n1,n2))

n = input()
a = int(n)
b = int(n[: -2] + n[-1])
c = int(n[: -1])
print(max(a, b, c))


from math import *
n = int(input())

if (n >= 0):
	print(n)
	return

n = -n

S = str(n)

L = []

L.append(n)

if (len(S) >= 2):
	S1 = S[:len(S) - 1]
	L.append(S1)

if (len(S) >= 2):
	S1 = S[:(len(S) - 2)] + S[len(S) - 1]
	L.append(S1)

for i in range(len(L)):
	L[i] = int(L[i])

print (-1 * min(L))

n = int(input())
print(max(n, (n // 100 if n > 0 else -((-n) // 100)) * 10 + (n % 10 if n > 0 else -((-n) % 10)), n // 10 if n > 0 else -((-n) // 10)))

n=int(input())
count1=n;
count2=int(float(n)/10);
count3=n;
count3=str(count3)
count4=count3[0:-2]
count4+=count3[-1]
count4=int(count4)
print(max(count4,count1,count2))

n = int(input())
if n >= 0:
    print(n)
else:
    n = - n
    a = n % 10
    n //= 10
    b = n % 10
    n //= 10
    n = n * 10 + min(a, b)
    print(-n)

s=input()

if(s[0]!='-'):
    print(s)

else:
    y=""
    n=len(s)
    for i in range(n):
        if(i==n-1):
            continue
        y+=s[i]
    z=""
    for i in range(n):
        if(i==n-2):
            continue
        z+=s[i]
    z=int(z)
    y=int(y)
    if(y>z):
        print(y)
    else:
        print(z)
        


n = input()
a = n[:-1]
b = n[:-2] + n[-1]
print(max(list(map(int, [a, b, n]))))


k=int(input())
if(str(k)[0]=='-'):
    st="-0"+ str(abs(k))
else:
    st="0"+ str(k)
a=int(st[:-1])
b=int(st[:-2]+str(k)[-1])
print(max(a,b,k))


3

n = input().strip()
print(max(list(map(int, [n, n[:-1], n[:-2] + n[-1]]))))


s = input()
ans = int(s)
if s[0] == '-' and len(s) >= 2:
  if len(s) == 2:
    ans = 0
  else:
    ans = max(int(s[:-1]), int(s[:-2]+s[-1]), ans)
print(ans)


import sys

s = sys.stdin.readline().strip()

a = int(s[:-1] if len(s) > 1 and s[:-1] != '-' else s)
b = int(s[:-2]+s[-1] if len(s) > 1 else s)
c = int(s)

print(max(a, b, c))


##A
n0=str(input())
n1=n0[:-1]
n2=n0[:-2]+n0[-1:]
n0=int(n0)
n1=int(n1)
n2=int(n2)
print(max(n1,n2,n0))

n = int(input())
if n < 0:
  n = -min(-n // 10, -n // 100 * 10 + -n % 10)
print(n)

s = input()
if s[0] == '-':
	if s[-1] >= s[-2]:
		if s[:-1] != '-0':
			print(s[:-1])
		else:
			print(0)
	else:
		if s[:-2] + s[-1] != '-0':
			print(s[:-2] + s[-1])
		else:
			print(0)
else:
	print(s)


import math
import re
from fractions import Fraction
from collections import Counter

class Task:
    n = 0
    answer = 0
    
    def __init__(self):
        self.n = input()

    def solve(self):
        n = self.n
        self.answer = max(int(n), int(n[:-2] + n[-1]), int(n[:-1]))

    def printAnswer(self):
        print(self.answer)

task = Task()
task.solve()
task.printAnswer()


def main():
	strn = input()
	n = int(strn)
	if n >= 0:
		print(n)
	else:
		del_last = int(strn[:-1])
		del_pult = int(strn[:-2] + strn[-1])
		print(max(n, del_pult, del_last))

def __starting_point():
	main()
__starting_point()

state = input("")
if( int(state) > 0):
    print(state)
elif( int(state) >= -10):
    print(0)
else:
    a = state[:-2]+state[-1]
    b = state[:-2]+state[-2]
    if( int(a) > int(b)):
        if( int(a) == 0):
            print(0)
        else:
            print(a)
    else:
        if( int(b) == 0):
            print(0)
        else:
            print(b)


# Задача про банковский счет. от 30.05.13
inner_data = input()
if int(inner_data) >= 0:
    print (inner_data)
else:
    inner_data = inner_data[1:]
    ee = ''
    if len(inner_data) >= 2:
        finded = 0
        for i in inner_data[::-1]:
            if i == inner_data[-2] and not finded:
                finded = 1
                continue
            ee = ee + i
    if int(inner_data[-1]) > int(inner_data[-2]):
        if (int(inner_data[-1]) == 0):
            if int(inner_data[-2]) != 0:
                print (0)
        elif int(inner_data[-1]) != 0:
            print ('-' + inner_data[0:-1])
            
    elif int(inner_data[-1]) < int(inner_data[-2]):
        if (int(ee[::-1]) == 0):
            print (0)
        else:
            print ('-' + ee[::-1])
    elif int(inner_data[-1]) == int(inner_data[-2]):
        print ('-' + ee[::-1])
    else:
        print (0)

a = int(input());
if a>0:
    print(a)
else:
    if (int(str(a)[-1]) > int(str(a)[-2])): print (str(a)[:-1])
    else:
        if str(a)[:-2] +  str(a)[-1] == "-0": print(0)
        else: print (str(a)[:-2], str(a)[-1],  sep='')

n = input()
a = int(n)
b = int(n[: -2] + n[-1])
c = int(n[: -1])
print(max(a, b, c))

def main():
    n = int(input())
  
    if n >-10:
        print(n)
    else:
        n = str(n*(-1))
        l = len(n)
        print(min(int(n[:l-1]),int(n[:l-2]+n[l-1]))*-1)
        
    
    
    
main()

def __starting_point():
    data = input()
    if int(data) >= 0:
        print(data)
    elif len(data) == 2:
        print('0')
    else:
        n = data[1:]
        l1 = n[:len(n)-1]
        l2 = n[:len(n)-2] + n[len(n)-1:]
        ans = min(int(l1), int(l2))
        ans *= -1
        print(ans)

__starting_point()

s = input()
print((max(list(map(int, [s, s[0:-1], s[0:-2] + s[-1]])))));