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 int inf = 1 << 30;
const int N = 1000100;
int n, a[N];
int seg[N << 2];
int lazy[N << 2];
void build(int nd, int L, int R) {
  if (L == R) {
    seg[nd] = 1;
    return;
  }
  int mid = (L + R) >> 1;
  build(nd << 1, L, mid);
  build(nd << 1 | 1, mid + 1, R);
  seg[nd] = seg[nd << 1] + seg[nd << 1 | 1];
}
void push(int nd, int L, int R) {
  if (lazy[nd] == 0) return;
  seg[nd] = 0;
  if (L != R) {
    lazy[nd << 1] += lazy[nd];
    lazy[nd << 1 | 1] += lazy[nd];
  }
  lazy[nd] = 0;
}
int query(int nd, int L, int R, int from, int to) {
  push(nd, L, R);
  if (from <= L && R <= to) return seg[nd];
  if (from > R || to < L) return 0;
  int mid = (L + R) >> 1;
  int leftAns = query(nd << 1, L, mid, from, to);
  int rightAns = query(nd << 1 | 1, mid + 1, R, from, to);
  return leftAns + rightAns;
}
void updateRange(int nd, int L, int R, int from, int to, int val) {
  push(nd, L, R);
  if (R < from || L > to) return;
  if (from <= L && R <= to) {
    lazy[nd] += val;
    push(nd, L, R);
    return;
  }
  int mid = (L + R) >> 1;
  updateRange(nd << 1, L, mid, from, to, val);
  updateRange(nd << 1 | 1, mid + 1, R, from, to, val);
  seg[nd] = seg[nd << 1] + seg[nd << 1 | 1];
}
int main() {
  scanf("%d", &n);
  build(1, 1, n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  for (int i = n; i >= 1; --i) {
    int from = i - a[i], to = i - 1;
    if (from > to) continue;
    updateRange(1, 1, n, from, to, 1);
  }
  for (int i = 1; i <= n; i++) query(1, 1, n, i, i);
  printf("%d", seg[1]);
  return 0;
}
