#include <bits/stdc++.h>
using namespace std;
int main(void) {
  vector<int> a;
  int n;
  int x;
  int ans = 0;
  scanf("%d", &n);
  for (int i = 0; i < (int)n; i++) {
    scanf("%d", &x);
    a.push_back(x);
  }
  reverse(a.begin(), a.end());
  x = 0;
  for (int i = 0; i < (int)n; i++) {
    if (x <= 0) ans++;
    x = max(x - 1, a[i]);
  }
  printf("%d\n", ans);
  return 0;
}
