#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  ll n;
  cin >> n;
  vector<ll> claws(n);
  for (ll i = 0; i < n; i++) {
    cin >> claws[i];
  }
  vector<ll> dead(n, 0);
  for (ll i = 0; i < n; i++) {
    dead[max(i - claws[i], 0ll)]++;
    dead[i]--;
  }
  ll ans = 0;
  vector<ll> d(n, 0);
  for (ll i = 0; i < n; i++) {
    if (i == 0) {
      d[i] = dead[0];
    } else
      d[i] = dead[i] + d[i - 1];
    if (d[i] == 0) {
      ans++;
    }
  }
  cout << ans;
}
