{"raw_statement":[{"iden":"problem statement","content":"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):\nOperation: Swap two **adjacent** elements in the permutation.\nYou want to have $p_i ≠ i$ for all $1≤i≤N$. Find the minimum required number of operations to achieve this."},{"iden":"constraints","content":"*   $2≤N≤10^5$\n*   $p_1,p_2,..,p_N$ is a permutation of $1,2,..,N$."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$p_1$ $p_2$ .. $p_N$"},{"iden":"sample input 1","content":"5\n1 4 3 5 2"},{"iden":"sample output 1","content":"2\n\nSwap $1$ and $4$, then swap $1$ and $3$. $p$ is now $4,3,1,5,2$ and satisfies the condition. This is the minimum possible number, so the answer is $2$."},{"iden":"sample input 2","content":"2\n1 2"},{"iden":"sample output 2","content":"1\n\nSwapping $1$ and $2$ satisfies the condition."},{"iden":"sample input 3","content":"2\n2 1"},{"iden":"sample output 3","content":"0\n\nThe condition is already satisfied initially."},{"iden":"sample input 4","content":"9\n1 2 4 9 5 8 7 3 6"},{"iden":"sample output 4","content":"3"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}