#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>

using namespace std;

float dist(int i, int j, const vector<float>& x, const vector<float>& y)
{
  return sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
}

float solve(vector<vector<float>>& dp, int i, int S, const vector<float>& x, const vector<float>& y)
{
  if (dp[i][S] >= 0)
    return dp[i][S];
  float res = 100000;
  for (int j = 0; j < x.size(); j++)
  {
    if (!(S >> j & 1))
    {
      res = min(res, solve(dp, j, S | (1 << j), x, y) + dist(i, j, x, y));
    }
  }
  dp[i][S] = res;
  return res;
}

int main()
{
  int n;
  cin >> n;
  vector<float> x(n), y(n);
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  vector<vector<float>> dp(n, vector<float>((1 << n) - 1, -1));
  for (int i = 0; i < n; i++)
    dp[i][(1 << n) - 1] = 0;
  float ans = 100000;
  for (int i = 0; i < n; i++)
  {
    ans = min(ans, solve(dp, i, 1 << i, x, y) + sqrt(x[i] * x[i] + y[i] * y[i]));
  }
  cout << fixed << setprecision(2) << ans;
  return 0;
}
