LearnPy Hub
← Arena
AdvancedRating 1500

Fewest Jumps

Same jumps as before, and the end is always reachable. Print the minimum number of jumps to reach the last index.

Input

n, then n integers.

Output

A count.

Sample 1

Input
5
2 3 1 1 4
Output
2

Sample 2

Input
1
0
Output
0
solution.py
Output appears here
Fewest Jumps · Python Arena problem · LearnPy Hub