A sequence of length is sorted if for every .
You may perform the following operation zero or more times: choose an integer with , add to , and subtract from every other element.
Elements may become negative during or after the operations. Every sequence can be made sorted using these operations. Find the minimum number of operations required to sort .
The input is given in the following format.
Print the minimum number of operations.
The first line contains the integer . The second line contains space-separated integers .
| 2 | 10 | . |
| 3 | 18 | . |
| 4 | 24 | At most two distinct values occur in . |
| 5 | 35 | No additional constraints. |