#include <bits/stdc++.h>
using namespace std;
int a[1000006];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int tv = n, ans = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (tv > i) {
      ans++;
    }
    tv = min(tv, i - a[i]);
  }
  cout << ans << endl;
  return 0;
}
