Minimum Number Of Swaps Required To Sort An Array
easy
Given an array of n distinct elements, find the minimum number of swaps required to sort the array.
Constraints
1 <= n <= 1000000 1 <= arr[i] <= 1000000000
Format
Input
First line contains an integer N . Second line has 2 space separated integers ai and bi.
Output
Print in one line the minimum number of swaps required to sort the given array.
Example
Sample Input
5
10 19 6 3 5
Sample Output
2