You are given a permutation.
A move is one of the following:
What is the minimum number of moves you need to make to sort the given permutation?
The first line contains a single integer n (1≤n≤3⋅105), the length of the permutation.
The second line contains n integers a_i (1≤a_i≤n), the permutation itself.
Output a single integer --- the minimum number of moves you need to make to sort the given permutation.