#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int a[1000000];
  int ans = n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  int nail = a[n - 1];
  for (int i = n - 2; i >= 0; --i) {
    if (nail) {
      --nail;
      --ans;
    }
    if (a[i] > nail) nail = a[i];
  }
  cout << ans << endl;
  ;
}
