#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  int result = 0;
  int tmp = 0;
  for (int i = n; i >= 1; i--) {
    if (tmp == 0) {
      result++;
    }
    tmp = max(arr[i], tmp - 1);
  }
  cout << result << endl;
}
