#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  }
  long long int n;
  cin >> n;
  vector<long long int> L(n);
  for (long long int i = 0; i < n; i++) {
    cin >> L[i];
  }
  long long int dead = 0;
  long long int claw = 0;
  for (long long int i = n - 1; i >= 0; i--) {
    if (claw > 0) {
      dead++;
    }
    if (claw - 1 < L[i]) {
      claw = L[i];
    } else
      claw = claw - 1;
  }
  cout << n - dead;
  return 0;
}
