#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0, k = 0;
  cin >> n;
  int* a = (int*)calloc(n, sizeof(int));
  int* res = (int*)calloc(n, sizeof(int));
  int* f = (int*)calloc(n, sizeof(int));
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    f[i] = 1;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (i - a[i] <= 0)
      res[i] = i;
    else
      res[i] = a[i];
    if (i == n - 1)
      count = res[i];
    else if (count > 0) {
      f[i] = 0;
      k++;
      count--;
    }
    if (res[i] > count) count = res[i];
  }
  cout << n - k;
  return 0;
}
