#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long a;
  cin >> a;
  long long arr[a];
  for (long long i = 0; i < a; i++) cin >> arr[i];
  long long ans = 0;
  long long yo = a;
  for (long long i = a - 1; i >= 0; i--) {
    if (yo > i) {
      ans++;
      yo = i - arr[i];
    }
    yo = min(yo, i - arr[i]);
  }
  cout << ans;
  return 0;
}
