#include <bits/stdc++.h>
using namespace std;
int a[105], n, ans = 2e9;
vector <int> v[1005];
void dfs(int x, int sum)
{
if (x == n)
{
ans = min(ans, sum);
sum = 0;
return;
}
for (int i = 0; i < v[x].size(); i++)
{
dfs(v[x][i], sum + 1);
}
}
int main()
{
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> a[i];
}
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= a[i]; j++)
{
if (i + j <= n)
{
v[i].push_back(i + j);
}
}
}
dfs(1, 0);
cout << ans;
return 0;
}