AT_abc435_c [ABC435C] Domino
Description
There are $ N $ dominoes standing in a row on a number line. The $ i $ -th domino is standing at coordinate $ i $ and has height $ A_i $ .
When the $ i $ -th domino falls to the right, all dominoes in the range between coordinates $ i $ and $ i+A_i-1 $ , inclusive, fall to the right.
How many dominoes will fall in total when the first domino falls to the right?
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ A_1 $ $ A_2 $ $ \ldots $ $ A_N $
Output Format
Output the number of dominoes that fall when the first domino falls to the right.
Explanation/Hint
### Sample Explanation 1
When the first domino falls to the right, the second and third dominoes also fall to the right. When the third domino falls to the right, the fourth domino also falls.
### Sample Explanation 2
When the first domino falls to the right, no other dominoes will fall.
### Constraints
- $ 1\leq N \leq 5\times 10^5 $
- $ 1\leq A_i \leq N $
- All input values are integers.