#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
int n;
int a[N], s[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    int l = max(1, i - a[i]);
    s[l] += 1;
    s[i] += -1;
  }
  int now = 0, ans = 0;
  for (int i = 1; i <= n; i++) {
    now += s[i];
    if (now == 0) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
