Cossack Vus is going on a journey. In Potokolandia n cities are located on a straight line and numbered with integers from 1 to n. Each city is characterized by a certain value xi — the city coordinate. The distance between the cities with numbers i and j is equal to ∣xi−xj∣.
Cossack Vus wants to know the minimum distance he will have to travel when traveling through Potokolandia, provided that he must visit each city at least once and complete the journey in the city where he started. Your task is to find the minimum length of the route, provided that the city where the journey starts and the route remains at your discretion.
The first line contains one integer n (1≤n≤100).
The second line contains n integers x1,x2,…,xn (1≤xi≤1000).
Print one integer — the minimum length of the route of Cossack Vus.