#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
long long a[10000000];
long long s[10000000];
int main() {
  long long n;
  cin >> n;
  long long cnt = n, j = n;
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = n - 1; i >= 0; i--) {
    if (i >= j) cnt--;
    j = min(j, i - a[i]);
  }
  cout << cnt;
  return 0;
}
