#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int arr[n];
  bool alive[n];
  scanf("%d", &arr[0]);
  alive[0] = true;
  for (int i = 1; i < n; i++) {
    scanf("%d", &arr[i]);
    alive[i] = true;
  }
  int i = n - 1, last_alive = n - 1, alives = 0;
  while (i > 0) {
    if (last_alive > i - arr[i]) {
      last_alive = i - arr[i];
    }
    if (last_alive < i) {
      alive[i - 1] = false;
    }
    i--;
  }
  for (int i = 0; i < n; i++) {
    if (alive[i]) {
      alives++;
    }
  }
  printf("%d", alives);
  return 0;
}
