Unification Day
Very easy
Execution time limit is 2 seconds
Runtime memory usage limit is 128 megabytes
Byteland has cities, but no one road. The king of the country, Waldemar de Bear, decided to remedy this situation, he wants to connect some cities with roads so that along these roads it will be possible to reach any city from any other city. When construction will be completed, the king plans to celebrate the Unification Day.
Unfortunately, the treasury in Byteland is almost empty, so the king needs to save money and minimize the total length of constructed roads.
Input
The first line contains the number of cities in Byteland. Each of the next lines contains two integers — the coordinates of -th city. No two cities are located in one point.
Output
Print the least total roads length. Print the answer with the accuracy no less than .
Examples
Input #1
Answer #1
Submissions 6K
Acceptance rate 20%