#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int n, ans = 1;
  cin >> n;
  int guilty[n];
  int dead[n];
  for (int i = 0; i < n; i++) cin >> guilty[i];
  dead[n - 1] = guilty[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    dead[i] = max(dead[i + 1] - 1, guilty[i]);
    if (dead[i + 1] == 0) ans++;
  }
  cout << ans;
  return 0;
}
