#include <bits/stdc++.h>
using namespace std;
int main() {
  int temp = 0, n;
  cin >> n;
  int arr[n];
  bool b[n];
  for (int j = 0; j < n; j++) {
    cin >> arr[j];
    b[j] = false;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (temp > 0) b[i] = true;
    temp--;
    temp = max(temp, arr[i]);
  }
  int ct = 0;
  for (int k = 0; k < n; k++) {
    if (!b[k]) ct++;
  }
  cout << ct << endl;
}
