/*水、模板题*/
#include<cstring>
#include<cstdio>#include<cmath>
#define INF 1<<30
double map[130][130],low[130],a[110],b[110];
int vis[130];
int n;
double dis(int i,int j)
{
return sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]));
}
double prim()
{
double ans=0;
for(int i = 0; i <= n; i++)
low[i] = map[0][i];
vis[0] = 1;
for(int i = 1; i < n; i++)
{
int temp = INF,pos=-1;
for(int j = 0; j < n; j++)
if(!vis[j]&&temp>low[j])
{
temp=low[j];
pos = j;
}
vis[pos] = 1;
ans += low[pos];
for(int j = 0; j < n; j++)
if(!vis[j]&&low[j]>map[pos][j])
low[j] = map[pos][j];
}
return ans;
}
int main()
{
while(scanf("%d",&n)==1)
{
memset(vis,0,sizeof(vis));
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
map[i][j] = INF;
for(int i = 0; i < n; i++)
{
scanf("%lf %lf",&a[i],&b[i]);
}
for(int i = 0; i < n; i++)
for(int j = i+1; j < n; j++)
map[i][j] = map[j][i] = dis(i,j);
printf("%.2lf\n",prim());
}
return 0;
}