#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int* a = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int k = n + 1;
  int ans = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (i < k) {
      ans++;
    }
    k = min(k, i - a[i]);
  }
  cout << ans;
}
