#include <bits/stdc++.h>
using namespace std;
int solve = 0;
int main() {
  int n;
  scanf("%d", &n);
  int cap[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &cap[i]);
  }
  int idx = n - 1;
  for (int i = n - 1; i >= 0; i--) {
    idx = min(idx, i);
    if (idx > i - cap[i]) {
      solve += min(idx, idx - i + cap[i]);
      solve = min(solve, n - 1);
      idx = max(0, i - cap[i]);
    }
    if (solve == n - 1 || idx == 0) break;
  }
  printf("%d\n", n - solve);
  return 0;
}
