include<bits/stdc++.h>

using namespace std;
int a[10000000];
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
for(int i = 1; i <= n; i++)
{
cin >> a[i];
}
int maxx = 0;
for(int i = n; i >= 1; i--)
{
maxx++;
if(a[i] > maxx)
{
maxx = a[i];
}
}
cout << maxx << "\n";
return 0;
}