#include <bits/stdc++.h>
using namespace std;
long long int n, l[1000101], p, ans;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> l[i];
  for (int i = n - 1; i >= 0; i--) {
    if (p == 0) ans++;
    p = max(p - 1, l[i]);
  }
  cout << ans << endl;
}
