#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 1;
  scanf("%d", &n);
  int pers[n];
  int mouta[n];
  for (int i = 0; i < n; i++) scanf("%d", &pers[i]);
  mouta[n - 1] = pers[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    if ((mouta[i + 1] - 1) >= pers[i])
      mouta[i] = mouta[i + 1] - 1;
    else
      mouta[i] = pers[i];
    if (mouta[i + 1] == 0) ans++;
  }
  cout << ans;
  return 0;
}
