#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const double EPS = 1e-9, INF = 1e12;
template <class T>
struct costflowGraph {
  struct edge {
    int to, cap, rev;
    T cost;
    edge(int to, int cap, T cost, int rev)
        : to(to), cap(cap), cost(cost), rev(rev) {}
  };
  int n, *prevv, *preve;
  T *dist;
  vector<vector<edge> > G;
  costflowGraph(int sz) : n(sz) {
    G.resize(n);
    dist = new T[n];
    prevv = new int[n];
    preve = new int[n];
  }
  ~costflowGraph() {
    delete dist;
    delete prevv;
    delete preve;
  }
  void add(int s, int t, int cap, T cost) {
    G[s].push_back(edge(t, cap, cost, G[t].size()));
    G[t].push_back(edge(s, 0, -cost, G[s].size() - 1));
  }
  T min_cost_flow(int s, int t, int f) {
    T res = 0;
    while (f > 0) {
      fill(dist, dist + n, inf);
      dist[s] = 0;
      while (1) {
        bool update = 0;
        for (int v = 0; v < (int)n; v++) {
          if (dist[v] == inf) continue;
          for (int i = 0; i < (int)G[v].size(); i++) {
            edge &e = G[v][i];
            if (e.cap > 0 && dist[e.to] > dist[v] + e.cost + EPS) {
              dist[e.to] = dist[v] + e.cost;
              prevv[e.to] = v;
              preve[e.to] = i;
              update = 1;
            }
          }
        }
        if (!update) break;
      }
      if (dist[t] == inf) return -1;
      int d = f;
      for (int v = t; v != s; v = prevv[v])
        d = min(d, G[prevv[v]][preve[v]].cap);
      f -= d;
      res += d * dist[t];
      for (int v = t; v != s; v = prevv[v]) {
        edge &e = G[prevv[v]][preve[v]];
        e.cap -= d;
        G[v][e.rev].cap += d;
      }
    }
    return res;
  }
};
int n, x[400], y[400];
int main() {
  cin >> n;
  for (int i = 0; i < (int)n; i++) cin >> x[i] >> y[i];
  int s = 2 * n, t = 2 * n + 1;
  costflowGraph<double> g(2 * n + 2);
  for (int i = 0; i < (int)n; i++) {
    g.add(s, i + n, 2, 0);
    g.add(i, t, 1, 0);
  }
  for (int i = 0; i < (int)n; i++)
    for (int j = 0; j < (int)n; j++)
      if (y[i] > y[j]) {
        g.add(i + n, j, 1, hypot(x[i] - x[j], y[i] - y[j]));
      }
  printf("%.12f\n", g.min_cost_flow(s, t, n - 1));
  return 0;
}
