Hands that shed innocent blood!

There are n guilty people in a line, the i-th of them holds a claw with length Li. The bell rings and every person kills some of people in front of him. All people kill others at the same time. Namely, the i-th person kills the j-th person if and only if j < i and j ≥ i - Li.

You are given lengths of the claws. You need to find the total number of alive people after the bell rings.

Input

The first line contains one integer n (1 ≤ n ≤ 106) — the number of guilty people.

Second line contains n space-separated integers L1, L2, ..., Ln (0 ≤ Li ≤ 109), where Li is the length of the i-th person's claw.

Output

Print one integer — the total number of alive people after the bell rings.

Examples

Input

4
0 1 0 10


Output

1


Input

2
0 0


Output

2


Input

10
1 1 3 0 0 0 2 1 0 3


Output

3

Note

In first sample the last person kills everyone in front of him.
#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e6 + 10;
inline long long read() {
  long long w = 1, data = 0;
  char ch = 0;
  while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();
  if (ch == '-') w = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') data = data * 10 + ch - '0', ch = getchar();
  return w * data;
}
long long n, a[MAXN];
struct Node {
  long long sum, setv;
};
struct XDS {
  Node v[MAXN << 2];
  void PushUp(long long rt) { v[rt].sum = v[rt << 1].sum + v[rt << 1 | 1].sum; }
  void Set(long long l, long long r, long long rt, long long C) {
    v[rt].sum = (r - l + 1) * C;
    v[rt].setv = C;
  }
  void PushDown(long long l, long long r, long long rt) {
    if (v[rt].setv != -1) {
      long long mid = (l + r) >> 1;
      Set(l, mid, rt << 1, v[rt].setv);
      Set(mid + 1, r, rt << 1 | 1, v[rt].setv);
      v[rt].setv = -1;
    }
  }
  void Build_Tree(long long l, long long r, long long rt) {
    v[rt].setv = -1;
    if (l == r) {
      v[rt].sum = 1;
      return;
    }
    long long mid = (l + r) >> 1;
    Build_Tree(l, mid, rt << 1);
    Build_Tree(mid + 1, r, rt << 1 | 1);
    PushUp(rt);
  }
  void Update(long long L, long long R, long long C, long long l, long long r,
              long long rt) {
    if (L <= l && r <= R) {
      Set(l, r, rt, C);
      return;
    }
    PushDown(l, r, rt);
    long long mid = (l + r) >> 1;
    if (L <= mid) Update(L, R, C, l, mid, rt << 1);
    if (R > mid) Update(L, R, C, mid + 1, r, rt << 1 | 1);
    PushUp(rt);
  }
} tree;
int main() {
  n = read();
  tree.Build_Tree(1, n, 1);
  for (long long i = 1; i <= n; i++) a[i] = read();
  for (long long i = 2; i <= n; i++) {
    long long x = max(1ll, i - a[i]);
    tree.Update(x, i - 1, 0, 1, n, 1);
  }
  printf("%I64d\n", tree.v[1].sum);
  return 0;
}
