#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int L[n];
  for (int i = 0; i < n; ++i) scanf("%d", &L[i]);
  int imos[n + 1];
  fill(imos, imos + n + 1, 0);
  for (int i = 0; i < n; ++i) {
    L[i] = min(L[i], i);
    ++imos[i - L[i]];
    --imos[i];
  }
  int t = 0, ans = n;
  for (int i = 0; i <= n; ++i) {
    t += imos[i];
    if (t > 0) --ans;
  }
  cout << ans << endl;
  return 0;
}
