#966. Fewest jumps
a[i] is the largest number of steps you can jump forward from position i. Find the fewest jumps to get from the first position to the last one. If it is impossible, print -1.
### Input
The first line has n, the second line has n integers separated by spaces.
### Output
A number.
Examples
Input
1 0
Output
0
Input
7 1 0 0 1 1 0 0
Output
-1
💡 You can solve it with Python, JavaScript or blocks. Read the input line by line with input(). Don't print a question (like input("Number: ")). Print exactly what the output asks for, nothing more.