#C8783. Maximum Climbing Height

    ID: 52803 Type: Default 1000ms 256MiB

Maximum Climbing Height

Maximum Climbing Height

You are given a sequence of mountain peaks and you start at the first peak. You can only move to a new peak if its height is greater than or equal to the current peak's height. Formally, you are given an integer \(n\) representing the number of peaks and a sequence \(h_1, h_2, \dots, h_n\) where \(h_i\) denotes the height of the \(i\)-th peak.

The climbing process is defined as follows:

\( \text{current_max} = h_1\) \(\text{for } i=2 \text{ to } n:\) \(\quad \text{if } h_i \geq \text{current_max, then set } \text{current_max} = h_i\) \)

Your task is to output the final \(\text{current_max}\), which represents the maximum height reached according to these rules.

inputFormat

The first line contains a single integer n (\(1 \le n \le 10^5\)), the number of points in the mountain range. The second line contains n space-separated integers representing the heights of the mountain peaks.

outputFormat

Output a single integer representing the maximum height that can be reached following the climbing rules.

## sample
5
1 3 2 5 4
5