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