#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 10;
const double eps = 1e-4;
const double mod = 1e9 + 7;
int n, m, t, b[MAX];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> b[i];
  t = n;
  m = b[n];
  for (int i = n - 1; i >= 1; i--) {
    if (m > 0) {
      m--;
      t--;
    }
    m = max(b[i], m);
  }
  cout << t << endl;
}
