The array is sorted in ascending order using the Selection Sort method. How many times does the first element change its position?
The first line contains the number of elements in the array (1 ≤ n ≤ 1000). The second line gives the array itself. It is guaranteed that all elements of the array are distinct and do not exceed 10^9 in absolute value.
Print the number of times the first element changes its position.
Example 1
Example 2
Example 3