#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int l[n];
  int d[n];
  for (long long i = 0; i < n; i++) {
    d[i] = 0;
  }
  for (long long i = 0; i < n; i++) {
    cin >> l[i];
    if (l[i] > i) {
      d[0]++;
      d[i]--;
    } else {
      d[i - l[i]]++;
      d[i]--;
    }
  }
  int al = 0;
  for (int i = 1; i < n; i++) {
    d[i] += d[i - 1];
  }
  for (long long i = 0; i < n; i++) {
    if (d[i] == 0) {
      al++;
    }
  }
  cout << al;
  return 0;
}
