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;
long long a[1000010], ans;
struct node {
  long long l, r, sum, lazy;
} tr[1000010 * 4];
void build(long long id, long long l, long long r) {
  tr[id].l = l;
  tr[id].r = r;
  tr[id].lazy = 0;
  if (l == r)
    tr[id].sum = 1;
  else {
    long long mid = (l + r) / 2;
    build(id * 2, l, mid);
    build(id * 2 + 1, mid + 1, r);
    tr[id].sum = tr[id * 2].sum + tr[id * 2 + 1].sum;
  }
}
void pushdown(long long id) {
  tr[id * 2].lazy = 1;
  tr[id * 2 + 1].lazy = 1;
  tr[id * 2].sum = 0;
  tr[id * 2 + 1].sum = 0;
  tr[id].lazy = 0;
}
void update(long long id, long long l, long long r, long long x) {
  if (l <= tr[id].l && r >= tr[id].r) {
    if (tr[id].lazy == 0) tr[id].lazy = 1;
    tr[id].sum = 0;
    return;
  }
  if (tr[id].lazy != 0) pushdown(id);
  long long mid = (tr[id].l + tr[id].r) / 2;
  if (r <= mid)
    update(id * 2, l, r, x);
  else if (l > mid)
    update(id * 2 + 1, l, r, x);
  else {
    update(id * 2, l, r, x);
    update(id * 2 + 1, l, r, x);
  }
  tr[id].sum = tr[id * 2].sum + tr[id * 2 + 1].sum;
}
void query(long long id, long long l, long long r) {
  if (l <= tr[id].l && r >= tr[id].r) {
    ans += tr[id].sum;
    return;
  }
  if (tr[id].lazy != 0) pushdown(id);
  int mid = (tr[id].l + tr[id].r) / 2;
  if (r <= mid)
    query(id * 2, l, r);
  else if (l > mid)
    query(id * 2 + 1, l, r);
  else {
    query(id * 2, l, mid);
    query(id * 2 + 1, mid + 1, r);
  }
}
int main() {
  long long n;
  scanf("%lld", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  build(1, 1, n);
  for (int i = 2; i <= n; i++) {
    long long l = max(1LL, i - a[i]);
    long long r = i - 1;
    if (l > r) continue;
    update(1LL, l, r, -1);
  }
  ans = 0;
  query(1, 1, n);
  printf("%lld\n", ans);
  return 0;
}
