#include <bits/stdc++.h>
using namespace std;
int gn;
int gl[1000010];
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  ;
  cin >> gn;
  for (int i = 1; i <= gn; i++) {
    cin >> gl[i];
  }
  int vt = 0;
  for (int vi = gn, vj = gn + 1; vi >= 1; vi--) {
    if (vi >= vj) {
      vt++;
    }
    if (vi - gl[vi] < vj) vj = vi - gl[vi];
  }
  cout << gn - vt << endl;
  return 0;
}
