hdu1162
/**/
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <stack>
#include <queue>
typedef long long LL;
using namespace std;
int n;
int cnt;
int f[105];
struct node
{
int u, v;
double w;
bool operator <(const node &a)const{
return w < a.w;
}
}a[5005];
int Find(int x){
return x == f[x] ? x : Find(f[x]);
}
void kruskal(){
sort(a, a + cnt);
int tot = 0;
double ans = 0;
for (int i = 1; i <= n; i++) f[i] = i;
for (int i = 0; i < cnt; i++){
int x = Find(a[i].u), y = Find(a[i].v);
if(x != y){
f[x] = y;
tot++;
ans += a[i].w;
if(tot == n - 1) break;
}
}
printf("%.2lf\n", ans);
}
int main()
{
//freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
while(scanf("%d", &n) == 1){
double x[n + 1], y[n + 1];
cnt = 0;
for (int i = 1; i <= n; i++){
scanf("%lf %lf", &x[i], &y[i]);
}
if(n == 1){
printf("0\n");
continue;
}
for (int i = 1; i <= n; i++){
for (int j = i + 1; j <= n; j++){
double w = sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
a[cnt].u = i, a[cnt].v = j, a[cnt].w = w;
cnt++;
}
}
kruskal();
}
return 0;
}
/**/