~/algor $ cat problems/minmax-17-oxirgi-maxdan-keyingi-sonlar
Numbers after the last maximum
Easy
1000 ms
256 MB
27%
A positive integer $N$ and $N$ integers are given. Find the number of elements that stand after the last occurrence of the largest element.
Input
The first line contains an integer $N$. The next line contains $N$ integers $A_{i}$.
Output
One integer — the number of elements after the last maximum.
Note
$1 \le N \le 1000$
$-10^{9} \le A_{i} \le 10^{9}$
Examples
Input #1
5 4 9 2 9 3
Output #1
1
Input #2
4 2 5 7 9
Output #2
0