#include<bits/stdc++.h>
using namespace std;
struct point{double x,y;}a[20];
int n;
double all=1<<30
; bool use[20];
void ( double x,double y,int sum,double ans){
if(sum==n){all=min(all,ans); return;}
for(int i=1;i<=n;i++)if(!use[i]){
double l=sqrt((x-a[i].x)*(x-a[i].x)+(y-a[i].y)*(y-a[i].y));
if(l+ans>all)continue;
use[i]=true; dfs(a[i].x,a[i].y,sum+1,ans+l); use[i]=false;
}
}
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++)scanf("%lf%lf",&a[i].x,&a[i].y);
dfs(0,0,0,0);
printf("%.2f",all);
return0;
}