#include <bits/stdc++.h>
using namespace std;
const int MAXN = 501;
int n;
int x[MAXN], y[MAXN];
namespace nflow {
const int INFINITE = 0x7FFFFFFF;
const int MAXV = 1001;
const int MAXE = 200001;
typedef int vtx[MAXV];
typedef int edg[MAXE];
int n, s, t, w;
vtx lk, ds;
edg nx, tl, cp;
queue<int> q;
inline void addEdge(int u, int v, int c) {
  if (!w) w++;
  w++, nx[w] = lk[u], lk[u] = w, tl[w] = v, cp[w] = c;
  w++, nx[w] = lk[v], lk[v] = w, tl[w] = u, cp[w] = 0;
}
inline bool BFS() {
  for (int i = 1; i <= n; ++i) ds[i] = 0;
  ds[s] = 1, q.push(s);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int e = lk[u]; e > 0; e = nx[e]) {
      int v = tl[e];
      if (cp[e] > 0 && !ds[v]) {
        ds[v] = ds[u] + 1;
        q.push(v);
      }
    }
  }
  return ds[t];
}
inline int DFS(int u, int curMin) {
  if (u == t) return curMin;
  int maxFlow = 0;
  for (int e = lk[u]; e > 0; e = nx[e]) {
    int v = tl[e];
    if (cp[e] > 0 && ds[v] == ds[u] + 1) {
      int flow = DFS(v, min(curMin, cp[e]));
      cp[e] -= flow, curMin -= flow;
      cp[e ^ 1] += flow, maxFlow += flow;
    }
  }
  return maxFlow;
}
inline int solve() {
  int res = 0, flow = 0;
  while (BFS())
    while (flow = DFS(s, INFINITE)) res += flow;
  return res;
}
}  // namespace nflow
namespace cflow {
const int INFINITE = 0x7FFFFFFF;
const int MAXV = 1001;
const int MAXE = 200001;
typedef int vtx[MAXV];
typedef int edg[MAXE];
int n, s, t, w;
double ds[MAXV], wt[MAXE];
vtx lk, ex, pr;
edg nx, tl, cp;
queue<int> q;
inline void addEdge(int u, int v, int c, double f) {
  if (!w) w++;
  w++, nx[w] = lk[u], lk[u] = w, tl[w] = v, cp[w] = c, wt[w] = f;
  w++, nx[w] = lk[v], lk[v] = w, tl[w] = u, cp[w] = 0, wt[w] = -f;
}
inline bool SPFA() {
  for (int i = 1; i <= n; ++i) ds[i] = INFINITE, ex[i] = false;
  ds[s] = 0, q.push(s);
  ex[s] = true;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    ex[u] = false;
    for (int e = lk[u]; e > 0; e = nx[e]) {
      int v = tl[e];
      if (cp[e] > 0 && ds[v] > ds[u] + wt[e]) {
        ds[v] = ds[u] + wt[e];
        pr[v] = e;
        if (!ex[v]) ex[v] = true, q.push(v);
      }
    }
  }
  return ds[t] < INFINITE;
}
inline double fordFulkerson() {
  int flow = INFINITE;
  double res = 0;
  for (int u = t; u != s; u = tl[pr[u] ^ 1]) flow = min(flow, cp[pr[u]]);
  for (int u = t; u != s; u = tl[pr[u] ^ 1]) {
    int e = pr[u];
    cp[e] -= flow, cp[e ^ 1] += flow;
    res += flow * wt[e];
  }
  return res;
}
inline double solve() {
  double res = 0;
  while (SPFA()) res += fordFulkerson();
  return res;
}
}  // namespace cflow
int s, t, idA[MAXN], idB[MAXN];
inline void assign() {
  s = ++t;
  for (int i = 1; i <= n; ++i) idA[i] = ++t;
  for (int i = 1; i <= n; ++i) idB[i] = ++t;
  t = ++t;
}
int main() {
  scanf("%d\n", &n);
  for (int i = 1; i <= n; ++i) scanf("%d %d\n", &x[i], &y[i]);
  assign();
  for (int i = 1; i <= n; ++i) nflow::addEdge(s, idA[i], 2);
  for (int i = 1; i <= n; ++i) nflow::addEdge(idB[i], t, 1);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (i != j && y[i] > y[j]) nflow::addEdge(idA[i], idB[j], 1);
  nflow::s = s, nflow::n = nflow::t = t;
  if (nflow::solve() < n - 1)
    printf("-1\n");
  else {
    for (int i = 1; i <= n; ++i) cflow::addEdge(s, idA[i], 2, 0);
    for (int i = 1; i <= n; ++i) cflow::addEdge(idB[i], t, 1, 0);
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j)
        if (i != j && y[i] > y[j])
          cflow::addEdge(idA[i], idB[j], 1,
                         (double)(sqrt(((x[i] - x[j]) * (x[i] - x[j])) +
                                       ((y[i] - y[j]) * (y[i] - y[j])))));
    cflow::s = s, cflow::n = cflow::t = t;
    double res = cflow::solve();
    printf("%.15f\n", res);
  }
  fclose(stdin);
  fclose(stdout);
  return 0;
}
