#d11305. 稳定数组
稳定数组
Stable Array
Problem Description
Given positive integers , in one operation for every with we set .
Find the minimum number of operations needed so that .
Input Format
The first line contains a positive integer .
The second line contains positive integers .
Output Format
One non-negative integer: the minimum number of operations.
Sample Input
4
16 24 10 5
Sample Output
3
Constraints