#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int INF = 1e9 + 7;
const int N = 2e5 + 7;
const int M = 1e6 + 7;
int n;
int sum[M];
signed main() {
  ios::sync_with_stdio(false);
  cin >> n;
  int x;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    x = max(1, i - x);
    sum[x] += 1;
    sum[i] -= 1;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    sum[i] += sum[i - 1];
    if (!sum[i]) ans++;
  }
  cout << ans << endl;
  return 0;
}
