The first line contains 2 interger - the length of permutation, and the number of operations.The Second Line contains integers - the permutation
For each test case, print a single integer, the minimum number of connected components.
4 2 1 2 3 4
2
In test case 1, We can get the optimal solution by and .
5 1 2 1 4 3 5