Cossack Vus is going on a journey. In Potokolandia, there are cities located on a straight line and numbered with integers from to . Each city is characterized by a certain value x_i — the coordinate of the city. The distance between cities with numbers and is equal to |x_i-x_j|.
Cossack Vus wants to find out the minimum distance he will have to travel while journeying through Potokolandia, given that he must visit each city at least once and finish the journey in the city where he started. Your task is to find the minimum route length, given that the city where Cossack starts his journey and his route are at your discretion.
The first line contains one integer (1\le n\le 100).
The second line contains integers x_1, x_2, \dots, x_n (1\le x_i\le 1000).
Print one integer — the minimum route length for Cossack Vus.
Example 1
Example 2