#include <bits/stdc++.h>
using namespace std;
template <class T>
void p(vector<T>& a) {
  for (int i = 0; i < a.size(); i++) cout << a[i] << " ";
  cout << endl;
}
int main() {
  std::ios::sync_with_stdio(false);
  int i, n;
  cin >> n;
  vector<int> l(n + 1);
  vector<int> v(n + 1, 0);
  for (i = 1; i < n + 1; i++) {
    cin >> l[i];
  }
  int alive = 0;
  int suf_sum = 0;
  for (i = n; i >= 1; i--) {
    suf_sum += v[i];
    if (suf_sum == 0) alive++;
    if (l[i] > 0) {
      if (i - l[i] - 1 > 0) v[i - l[i] - 1]--;
      v[i]++;
      suf_sum++;
    }
  }
  cout << alive << endl;
  return 0;
}
