#include <bits/stdc++.h>
using namespace std;
int n, a[1000006], b[1000006];
int main() {
  while (scanf("%d", &n) != EOF) {
    memset(a, 0, sizeof a);
    memset(b, 0, sizeof b);
    for (int i = 0; i < n; i++) scanf("%d", &a[i]);
    for (int i = n; i--;) {
      for (int j = max(i - a[i], 0); j < i && !b[j]; j++) b[j] = 1;
    }
    int ans = n;
    for (int i = n; i--;) ans -= b[i];
    printf("%d\n", ans);
  }
  return 0;
}
