#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1000 * 1000 + 10;
int n, arr[Maxn];
vector<int> v;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  v.push_back(0);
  for (int i = 1; i < n; i++) {
    while ((int)v.size() > 0 && v.back() >= i - arr[i]) v.pop_back();
    v.push_back(i);
  }
  cout << (int)v.size() << endl;
  return 0;
}
