#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int size = 1e6 + 10;
long long a[size], b[size], n, m, k, sum;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  reverse(a, a + n);
  for (int i = 0; i < n; i++) {
    b[i + 1] += 1;
    b[min(n + 10, i + a[i] + 1)] -= 1;
  }
  a[0] = b[0];
  long long sum = 0;
  for (int i = 1; i < n; i++) {
    a[i] = a[i - 1] + b[i];
    if (a[i] > 0) sum++;
  }
  cout << n - sum;
}
