#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  bool kill[n];
  memset(kill, false, sizeof(kill));
  long long streak = a[n - 1];
  for (int i = n - 2; i >= 0; --i) {
    if (streak) kill[i] = true;
    streak--;
    streak = max(streak, a[i]);
  }
  long long cnt = 0;
  for (int i = 0; i < n; ++i)
    if (!kill[i]) cnt++;
  cout << cnt;
  return 0;
}
