#include <bits/stdc++.h>
using namespace std;
int a[1000005];
int main() {
  int n, ans = 1;
  while (scanf("%d", &n) != EOF) {
    ans = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
    }
    int now = n;
    while (now >= 1) {
      ans++;
      if (a[now] == 0) {
        now--;
        continue;
      } else {
        int tmp1 = now - a[now];
        while (now >= 1 && tmp1 != now) {
          now--;
          if (tmp1 > now - a[now]) {
            tmp1 = now - a[now];
          }
        }
        if (now == tmp1) {
          now--;
        }
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
