Time limit: 1.00 s Memory limit: 512 MB
You are given an array of
On each move, you may increase the value of any element by one. What is the minimum number of moves required?
Input
The first input line contains an integer
Then, the second line contains
Output
Print the minimum number of moves.
Constraints
- 1
$\leq$ $n$ $\leq$ 2$\cdot$ $10^{5}$ - 1
$\leq$ $x_{i}$ $\leq$ $10^{9}$
Example
Input:
5
3 2 5 1 7
Output:
5