#include <bits/stdc++.h>
using namespace std;
int n;
int d[1000005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    int cl;
    cin >> cl;
    d[max(i - cl, 1)] += 1;
    d[i] -= 1;
  }
  int res = 0;
  int delta = 0;
  for (int i = 1; i <= n; ++i) {
    delta += d[i];
    if (delta == 0) res++;
  }
  cout << res << "\n";
  return 0;
}
