#include<iostream>
#include<math.h>
using namespace std ;
const int N=1001;
int n;
bool st[N];
double x[N];
double y[N];
double dis[N][N];
double ans=123123123.0;
void dfs(int step,int now,double len)
//step为走的步数,now为此时的点,len为长度
{
if(len>ans) return ;
if(step==n) {
ans=min(ans,len);
return ;
}
for(int i=1; i<=n; i++)
if(!st[i]) {
st[i]=1;
dfs(step+1,i,len+dis[now][i]);
st[i]=0;
}
}
int main() {
cin>>n;
for(int i=1; i<=n; i++)
cin>>x[i]>>y[i];
x[0]=y[0]=0;
for(int i=0; i<=n; i++)
for(int j=0; j<=n; j++)
dis[i][j]=sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]));
dfs(0,0,0.0);
printf("%.2f",ans);
return 0;
}