#include <bits/stdc++.h>
using namespace std;
int ara[1000009];
int main() {
  int i, j, k, l, m, n, p, q, cnt;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &ara[i]), ara[i] = min(ara[i] + 1, i);
  }
  cnt = 0, m = n;
  for (i = n; i >= 1; i--) {
    if (i <= m) cnt++;
    m = min(m, i - ara[i]);
  }
  printf("%d\n", cnt);
  return 0;
}
