#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int* arr1 = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> arr1[i];
  }
  int lastPos = n - 1;
  int currentPos;
  int killedPeople = 0;
  for (int j = n - 1; j > 0; j--) {
    if (j < lastPos) {
      lastPos = j;
    }
    currentPos = j - arr1[j];
    if (currentPos < 0) {
      currentPos = 0;
    }
    if (lastPos > currentPos) {
      killedPeople += (lastPos - currentPos);
      lastPos = currentPos;
    }
    if (lastPos == 0) {
      break;
    }
  }
  cout << (n - killedPeople);
  return 0;
}
