#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, c = 0;
  cin >> n;
  int a[n];
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int sum = n + 1;
  for (i = n; i >= 1; i--) {
    if (i < sum) c++;
    sum = min(sum, i - a[i]);
  }
  cout << c;
  return 0;
}
