P8597 [AtCoder] 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

输入格式

见题面

输出格式

见题面

样例输入
5 1 4 3 5 2
样例输出
2