You are given a sequence of positive integers . Repeat the following operation until exactly one integer remains.
Whether an integer is increased is determined by its value before the increases in that operation. If several integers have the same value, only the chosen occurrence is removed.
Find the minimum possible value of the last remaining integer.
The input is given in the following format:
Print the minimum possible value of the last remaining integer.