#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10;
long long int claws[MAXN];
int main() {
  int n;
  scanf("%d", &n);
  int sum = n;
  for (int i = 0; i < n; i++) scanf("%I64d", &claws[i]);
  int man = n - 1;
  long long int kill = man - claws[man];
  for (int i = n - 1; i >= 0; i--) {
    if (i < kill) {
      sum -= (man - kill);
      man = i;
      kill = i - claws[i];
    } else if (i - claws[i] < kill) {
      kill = i - claws[i];
    }
  }
  sum -= man;
  printf("%d\n", sum);
}
