#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> l(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &l[i]);
  }
  int stack = 0;
  int num = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (stack <= 0) {
      num++;
    }
    stack = max(stack - 1, l[i]);
  }
  cout << num << endl;
}
