#include <bits/stdc++.h>
using namespace std;
int l[1000010];
int main() {
  int n, x, live = 0;
  cin >> n;
  x = n;
  for (int i = 0; i < n; i++) scanf("%d", &l[i]);
  for (int i = n - 1; i >= 0; i--) {
    if (i < x) live++;
    if (i - l[i] < x) x = i - l[i];
  }
  cout << live << endl;
}
