You are given an integer sequence of length .
In one operation, choose one or more distinct positions and decrease the element at each chosen position by . Elements are allowed to become negative.
Find the minimum number of operations needed to make all elements equal. If they are already equal, you may perform no operations.
The input is given in the following format:
Print the minimum number of operations needed to make all elements equal.
The first line contains the length . The second line contains the elements , separated by spaces.