#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, j, a, z = 0, sz, kill = 0, mi = 99999999999;
  vector<long long> v;
  cin >> n;
  for (i = 0; i < n; i++) {
    scanf("%lld", &a);
    v.push_back(max((i - a), z));
  }
  mi = n - 1;
  sz = v.size();
  for (i = sz - 1; i >= 1; i--) {
    if (v[i] < mi) {
      if (i >= mi)
        kill = kill + (max(z, (mi - v[i])));
      else
        kill = kill + (max(z, (i - v[i])));
      mi = v[i];
    }
  }
  cout << n - kill << endl;
  return 0;
}
