#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  scanf("%I64d", &n);
  long long mas[n];
  for (long long i = 0; i < n; i++) {
    scanf("%I64d", &mas[i]);
    mas[i] = i - mas[i];
  }
  long long bord = n, sum = 0;
  for (long long i = n - 1; i >= 0; i--) {
    if (i < bord) sum++;
    if (mas[i] < bord) {
      bord = mas[i];
    }
  }
  cout << sum;
  return 0;
}
