Ahmed participated in the computer science subject competition and won a silver medal. It is known that participants who score the same points are awarded the same medal. It is also known that gold, silver, and bronze medals have been awarded. It is necessary to determine how many points Ahmed scored.
The first line contains the number of participants (2 ≤ n ≤ 1000) in the competition, and the second line contains the space-separated results of participants.
Output Ahmed's result.
Example 1