#include <bits/stdc++.h>
using namespace std;
int Array[1000005];
int main() {
  int index, Num, N, i, Ans = 0;
  scanf("%d", &N);
  for (i = 1; i <= N; ++i) scanf("%d", Array + i);
  index = N + 1;
  for (i = N; i >= 1; --i) {
    Num = i - Array[i];
    if (index > i) ++Ans;
    index = min(index, max(1, Num));
  }
  printf("%d\n", Ans);
  return 0;
}
