#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.141592653589793238463;
long long int m = 1000000007;
int main() {
  long long int n;
  cin >> n;
  long long int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  long long int v = a[n - 1], c = 1;
  for (int i = n - 2; i >= 0; i--) {
    if (v == 0) c++;
    v--;
    v = max(v, a[i]);
  }
  cout << c;
}
