#include <bits/stdc++.h>
using namespace std;
const int N = 201;
int n;
double f[1 << 17][21] ,x[N] ,y[N] ,a[N][N] ,ans = 1e9;
double dsert(double x ,double y ,double fx ,double fy){
return sqrt((fx - x) * (fx - x) + (fy - y) * (fy - y));
}
int main(){
memset(f ,127 ,sizeof f);
cin >> n;
x[0] = y[0] = 0;
for(int i = 1;i <= n;i ++){
cin >> x[i] >> y[i];
}
for(int i = 0;i <= n;i ++){
for(int j = 0;j <= n;j ++){
a[i][j] = dsert(x[i] ,y[i] ,x[j] ,y[j]);
}
}
for(int i = 1;i <= n;i ++){
f[1 << (i - 1)][i] = a[0][i];
}
for(int k = 1;k < (1 << n);k ++){
for(int i = 0;i <= n;i ++){
if(k & (1 << (i - 1)) == 0) continue;
for(int j = 0;j <= n;j ++){
if(i == j || !(k & (1 << (j - 1)))) continue;
f[k][i] = min(f[k][i] ,f[k - (1 << (i - 1))][j] + a[j][i]);
}
}
}
for(int i = 1;i <= n;i ++)ans = min(ans ,f[(1 << n) - 1][i]);
printf("%.2lf" ,ans);
}