#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxx=10010;
const int maxn=101;
double xx[maxn],yy[maxn];
int pa[maxx],rank1[maxx];
double ans;
struct edge{
int u,v;
double c;
}e[maxx];
bool cmp(const edge& e1,const edge& e2){
return e1.c<e2.c;
}
void make(int x){
pa[x]=x;
rank1[x]=0;
}
int findd(int x){
if(x!=pa[x])
pa[x]=findd(pa[x]);
return pa[x];
}
void unite(int x,int y,double w){
x=findd(x);
y=findd(y);
if(x==y)
return ;
ans+=w;
if(rank1[x]>rank1[y])
pa[y]=x;
else{
pa[x]=y;
if(rank1[x]==rank1[y])
rank1[y]++;
}
}
int main(){
int n;
double x,y;
while(~scanf("%d",&n)){
int k=0;
for(int i=1;i<=n;i++){
scanf("%lf%lf",&xx[i],&yy[i]);
}
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
e[k].u=i;
e[k].v=j;
e[k].c=sqrt((xx[i]-xx[j])*(xx[i]-xx[j])+(yy[i]-yy[j])*(yy[i]-yy[j]));
k++;
}
}
sort(e,e+k,cmp);
for(int i=1;i<=n;i++)
make(i);
ans=0.0;
for(int i=0;i<k;i++){
unite(e[i].u,e[i].v,e[i].c);
}
printf("%.2f\n",ans);
}
}
#include <cstring>
#include <algorithm>
using namespace std;
const int maxx=10010;
const int maxn=101;
double xx[maxn],yy[maxn];
int pa[maxx],rank1[maxx];
double ans;
struct edge{
int u,v;
double c;
}e[maxx];
bool cmp(const edge& e1,const edge& e2){
return e1.c<e2.c;
}
void make(int x){
pa[x]=x;
rank1[x]=0;
}
int findd(int x){
if(x!=pa[x])
pa[x]=findd(pa[x]);
return pa[x];
}
void unite(int x,int y,double w){
x=findd(x);
y=findd(y);
if(x==y)
return ;
ans+=w;
if(rank1[x]>rank1[y])
pa[y]=x;
else{
pa[x]=y;
if(rank1[x]==rank1[y])
rank1[y]++;
}
}
int main(){
int n;
double x,y;
while(~scanf("%d",&n)){
int k=0;
for(int i=1;i<=n;i++){
scanf("%lf%lf",&xx[i],&yy[i]);
}
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
e[k].u=i;
e[k].v=j;
e[k].c=sqrt((xx[i]-xx[j])*(xx[i]-xx[j])+(yy[i]-yy[j])*(yy[i]-yy[j]));
k++;
}
}
sort(e,e+k,cmp);
for(int i=1;i<=n;i++)
make(i);
ans=0.0;
for(int i=0;i<k;i++){
unite(e[i].u,e[i].v,e[i].c);
}
printf("%.2f\n",ans);
}
}