Journey
Cossack Vus is going on a journey. In Potokolandia cities are located on a straight line and numbered with integers from to . Each city is characterized by a certain value — the city coordinate. The distance between the cities with numbers and is equal to .
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.
Input
The first line contains one integer ().
The second line contains integers ().
Output
Print one integer — the minimum length of the route of Cossack Vus.