~/algor $ cat problems/eng-uzun-sakrash
Longest jump
Easy
1000 ms
64 MB
29%
In the long jump, an athlete made $n$ attempts. The result of each attempt is given in centimetres; a foul attempt is marked $-1$ and does not count. Find the athlete's longest counted jump. If all attempts are fouls, print $0$.
Input
The first line contains a positive integer $n$.
The second line contains $n$ integers — the results.
Output
One integer — the longest jump or $0$.
Note
$1 \le n \le 100$
each result is $-1$ or from $1$ to $1000$
Examples
Input #1
6 745 -1 802 -1 790 -1
Output #1
802
Input #2
3 -1 -1 -1
Output #2
0