#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592653589793238;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= 1000000007;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
  }
  return res;
}
int cnt, sum;
int arr[1000005];
int main() {
  int n, l, r;
  long long L;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &L);
    r = i;
    l = max(0ll, (long long)i - L);
    arr[l] += 1;
    arr[r] -= 1;
  }
  for (int i = 0; i < n; i++) {
    sum += arr[i];
    if (sum == 0) cnt++;
  }
  printf("%d\n", cnt);
  return 0;
}
