#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e6;
const long long maxn = 1e6 + 5;
int L[maxn];
int mark[maxn];
int main() {
  int n;
  while (scanf("%d", &n) == 1) {
    for (int i = 1; i <= n; i++) {
      scanf("%d", &L[i]);
      mark[i] = 1;
    }
    int ans = 1;
    int nx = n - L[n] - 1;
    for (int i = n - 1; i >= 1; i--) {
      if (i <= nx) {
        ans++;
      }
      nx = min(nx, i - L[i] - 1);
    }
    printf("%d\n", ans);
  }
  return 0;
}
