#include <bits/stdc++.h>
int main() {
  int N, L, i, count = 0, vivos = 0;
  int vet[1000000];
  scanf("%d", &N);
  for (i = N - 1; i >= 0; i--) {
    scanf("%d", &vet[i]);
  }
  for (i = 0; i < N; i++) {
    if (count == 0) {
      count = vet[i];
      vivos++;
    } else {
      count--;
      if (vet[i] > count) {
        count = vet[i];
      }
      if (count == 0) {
        count = vet[i];
      }
    }
  }
  printf("%d\n", vivos);
  return 0;
}
