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