#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int n, f, c;
  double v;
  Edge(int n = 0, int f = 0, int c = 0, double v = .0)
      : n(n), f(f), c(c), v(v) {}
};
int N, lim, maxFlow, last[2 * 410], from, to, pt[2 * 410];
bool mk[2 * 410];
double ans, d[2 * 410], eps = 1e-15;
vector<Edge> E;
vector<pair<int, int> > P;
vector<int> G[2 * 410];
queue<int> Q;
bool build() {
  for (int i = from; i <= to; ++i)
    d[i] = 1000000000, last[i] = -1, mk[i] = false;
  d[from] = 0.0;
  Q.push(from);
  for (int nod, nxt; !Q.empty(); Q.pop()) {
    nod = Q.front();
    for (int id : G[nod]) {
      nxt = E[id].n;
      if (E[id].c - E[id].f >= lim && d[nxt] - d[nod] - E[id].v > eps) {
        d[nxt] = d[nod] + E[id].v;
        last[nxt] = nod;
        Q.push(nxt);
      }
    }
  }
  return d[to] != 1000000000;
}
bool push(int nod, int flow) {
  if (!flow) return false;
  if (nod == to) return true;
  for (int id, nxt; pt[nod] < G[nod].size(); ++pt[nod]) {
    id = G[nod][pt[nod]];
    nxt = E[id].n;
    if (E[id].c - E[id].f >= flow && nod == last[nxt] && push(nxt, flow)) {
      E[id].f += flow;
      E[id ^ 1].f -= flow;
      ans += E[id].v;
      return true;
    }
  }
  return false;
}
void dinic() {
  for (lim = 1024; lim > 0;) {
    if (!build())
      lim >>= 1;
    else {
      for (int i = from; i <= to; ++i) pt[i] = 0;
      while (push(from, lim)) maxFlow += lim;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  cin >> N;
  from = 0;
  to = 2 * N + 1;
  for (int i = 1, a, b; i <= N; ++i) cin >> a >> b, P.push_back({a, b});
  for (int i = 0; i < N; ++i) {
    G[from].push_back(E.size());
    E.push_back(Edge(i + 1, 0, 2, 0.0));
    G[i + 1].push_back(E.size());
    E.push_back(Edge(from, 2, 2, 0.0));
  }
  for (int i = 0; i < N; ++i)
    for (int j = 0; j < N; ++j)
      if (P[i].second > P[j].second) {
        G[i + 1].push_back(E.size());
        E.push_back(Edge(j + 1 + N, 0, 1,
                         sqrt(pow(abs(P[i].first - P[j].first), 2) +
                              pow(abs(P[i].second - P[j].second), 2))));
        G[j + 1 + N].push_back(E.size());
        E.push_back(Edge(i + 1, 1, 1,
                         -sqrt(pow(abs(P[i].first - P[j].first), 2) +
                               pow(abs(P[i].second - P[j].second), 2))));
      }
  for (int i = N + 1; i <= 2 * N; ++i) {
    G[i].push_back(E.size());
    E.push_back(Edge(to, 0, 1, 0.0));
    G[to].push_back(E.size());
    E.push_back(Edge(i, 1, 1, 0.0));
  }
  dinic();
  if (maxFlow != N - 1) return !printf("-1\n");
  cout << fixed << setprecision(15) << ans << '\n';
  return 0;
}
