#000061

domine

In our little city Abensibeu people have different habits and traditions from the rest of the country. In this little city, people are playing dominoes with a bunch of dominos that are of different sizes. On some of the dominos there are up to 200 numbers, sorted in rows. On some of them there is just one number. Jovica and Perica bought this strange set of dominoes but there weren't instructions in the box. And because they aren't from Abensibeu, they don't know how to play with dominos that are different sizes. So, they decided set up the dominoes in a row, which falls down when you push the first domino. After a few days of setting up, they joined a long string of dominoes, with equally spaced dominoes. However, they don't know how many dominos will fall if they push the first one. And because they worked really hard to set it up, they don't want to destroy it and then count the dominoes that fell.
That's why you need to help them count the number of dominoes that will fall.



Image: domine1


InputThe first line of the standard input contains the natural number n (1<=n<=100000) which represent the number of dominoes they are using. In the next n rows there is the height of all the dominoes. The space between two adjacent dominoes is 1. One domino will push down the next domino only if the space between them is less then the heights of those dominoes.

OutputTo the standard output write the number of dominoes that will fall if you push the first one.



input:

6
2
3
1
2
1
1


output:

5


Explanation:

Image: domine2


The first domino pushes down the second, the second pushes down the third and the fourth, the fourth pushes down the fifth, and the sixth one remains upright.

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.