#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, i, j, sum, ctr, pos;
  cin >> n;
  vector<int> l(n);
  vector<pair<int, int> > a(n);
  for (i = 0; i < n; i++) {
    cin >> l[i];
    a[i].first = i - l[i];
    if (a[i].first < 0) a[i].first = 0;
    a[i].second = i - 1;
  }
  sort(a.begin(), a.end());
  ctr = -1;
  sum = 0;
  for (i = 0; i < n; i++) {
    if (ctr == -1) {
      ctr = a[i].second + 1;
      sum += a[i].second - a[i].first + 1;
    } else {
      if (a[i].second >= ctr) {
        if (a[i].first > ctr) {
          sum += a[i].second - a[i].first + 1;
        } else {
          sum += a[i].second - ctr + 1;
        }
        ctr = a[i].second + 1;
      }
    }
  }
  cout << n - sum << endl;
  return 0;
}
