Alice has recently found an array a containing N integers. As we all know Alice loves sorted array so, he wants to sort the array. To sort an array Alice can add 1 to any integer in the array in 1 move.
Alice wants to find minimum number of moves needed to sort this array. Remember that after sorting the array, all elements in it should be distinct.
INPUT CONSTRAINTS
INPUT FORMAT
First line of input contains a single integer N.
Second line of input contains N space separated inegers, elements of array a.
OUTPUT FORMAT
Output a single integer, denoting number of moves needed to sort the given array.
In first move Alice will add 1 to third integer then, in second move Alice will do the same he did in 1st move.