1039 - Robot Lab   

Description

Robot Lab is a lab filled with a lot of NPCs. In the lab, there is more devices needed power. Therefore, there is two power supply lines x=0 and y=0.

You need to buy some horizontal or vertical cables to connect these devices to one of the power supply lines. But you can't connect two cables. It means you should connect the devices to the power supply line "directly" with the cable. What is the minimum length of the total cables you buy? To simplify the problem, we guarantee every two devices must be at different x-coordinate and different y-coordinate.


Input

The input includes multiple test cases. 

In each test case, the first line contains one integer n

In the next n lines, every line contains two integers xi, yi.

1 ≤ n ≤ 100

-10000 ≤ xi, yi ≤ 10000


Output

The one line contains one integer, which indicates the minimum value of the sum.

Sample Input  Download

Sample Output  Download

Tags




Discuss