Silver medal#1957

Silver medal

1 second
128 megabytes
Very easy

Vasiliy competed in hokkeybol and won a silver medal in the individual event. It is known that participants who scored the same number of points will be awarded the same awards. It is also known that gold, silver, and bronze medals were awarded. The rules of hokkeybol are not important for this problem. You only need to determine how many points were scored by Vasiliy.

Input

The first line contains the number of athletes (2 \le n \le 1000) participating in competitions. In the second line integers are given - the results of competition.

Output

Print one integer - the result of Vasiliy.

Examples

Example 1

Loading
Loading