Maximum in Unimodal Sequence#10867

Maximum in Unimodal Sequence

1 second
128 megabytes
Very easy

Sequence a_i is called unimodal if there exists such index that a_1 < a_2 < \ldots < a_p and a_p > a_{p+1} > \ldots > a_n. Value a_p is maximum in this sequence. You must find this value.

Input

The first line contains the size of array n~(n \le 10^6). The next line contains positive integers that represent a unimodal sequence. Numbers in array do not exceed 10^9.

Output

Print the maximum element in the unimodal sequence.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading