#arc082b. [arc082_b]Derangement

[arc082_b]Derangement

Problem Statement

You are given a permutation p1,p2,...,pNp_1,p_2,...,p_N consisting of 11,22,..,NN. You can perform the following operation any number of times (possibly zero):

Operation: Swap two adjacent elements in the permutation.

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

Constraints

  • 2N1052≤N≤10^5
  • p1,p2,..,pNp_1,p_2,..,p_N is a permutation of 1,2,..,N1,2,..,N.

Input

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

NN p1p_1 p2p_2 .. pNp_N

Output

Print the minimum required number of operations


Sample Input 1

5
1 4 3 5 2

Sample Output 1

2

Swap 11 and 44, then swap 11 and 33. pp is now 4,3,1,5,24,3,1,5,2 and satisfies the condition. This is the minimum possible number, so the answer is 22.


Sample Input 2

2
1 2

Sample Output 2

1

Swapping 11 and 22 satisfies the condition.


Sample Input 3

2
2 1

Sample Output 3

0

The condition is already satisfied initially.


Sample Input 4

9
1 2 4 9 5 8 7 3 6

Sample Output 4

3