$n$ sticks stand in a row. Looking from the right, a stick is visible only if every stick to its right is strictly shorter. Print how many sticks are visible.
Input
Line 1: $n$ ($1 \le n \le 100000$). Line 2: $n$ heights in $[1, 100000]$.
Output
Print the number of visible sticks.
Example 1
Input
6 6 9 7 6 4 6
Output
3
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.