p03612 AtCoder Beginner Contest 072 - Derangement
You are given a permutation p_1,p_2,...,p_N consisting of 1,2,..,N. You can perform the following operation any number of times (possibly zero):

Operation: Swap two adjacent elements in the permutation.

You want to have p_i ≠ i for all 1≤i≤N. Find the minimum required number of operations to achieve this.

Constraints

* 2≤N≤10^5
* p_1,p_2,..,p_N is a permutation of 1,2,..,N.

Input

The input is given from Standard Input in the following format:


N
p_1 p_2 .. p_N


Output

Print the minimum required number of operations

Examples

Input

5
1 4 3 5 2


Output

2


Input

2
1 2


Output

1


Input

2
2 1


Output

0


Input

9
1 2 4 9 5 8 7 3 6


Output

3
```python
N = int(input())
p = list(map(int, input().split()))
p.append(0)
cnt = 0
for i in range(N):
  if p[i] == i + 1:
    p[i], p[i+1] = p[i+1], p[i] 
    cnt += 1
print (cnt)

```