import std.stdio;
import std.algorithm;
import std.conv;
import std.array;
import std.string;

void main() {
  int n = readln.chomp.to!int;
  auto L = readln.chomp.split.map!(to!int).array;
  int[] is_alive = new int[n];

  for (int i = n - 1; i > 0; i--) {
    if (L[i] == 0) continue;
    int idx = max(0, i - L[i]);
    is_alive[idx] += 1;
    is_alive[i] -= 1;
  }

  int ans = 0;

  for (int i = 1; i < n; ++i) is_alive[i] += is_alive[i - 1];
  for (int i = 0; i < n; ++i) if (is_alive[i] == 0) ans++;

  ans.writeln;
}
