#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> aa(n, 0);
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (a) {
      aa[max(0, i - a)] += 1;
      aa[i] -= 1;
    }
  }
  int ans = n, cur = 0;
  for (int i = 0; i < n; i++) {
    cur += aa[i];
    if (cur) ans--;
  }
  cout << ans << endl;
  return 0;
}
