#include <bits/stdc++.h>
using namespace std;
const int MX = 800 + 20;
const int INF = 1e9;
int read() {
  char k = getchar();
  int x = 0, flg = 1;
  while (k < '0' || k > '9') flg *= k == '-' ? -1 : 1, k = getchar();
  while (k >= '0' && k <= '9') x = x * 10 + k - '0', k = getchar();
  return x * flg;
}
int head[MX], tot = 1;
struct edge {
  int node, next, w;
  double c;
} h[MX * MX * 4];
void addedge(int u, int v, int w, double c, int flg = 1) {
  h[++tot] = (edge){v, head[u], w, c}, head[u] = tot;
  if (flg) addedge(v, u, 0, -c, false);
}
string s;
int n;
int pre[MX], flow[MX], inq[MX];
double dis[MX];
bool spfa() {
  for (int i = 1; i <= ((2 * n + 1) + 1); ++i) dis[i] = INF;
  queue<int> q;
  q.push((2 * n + 1)), pre[((2 * n + 1) + 1)] = 0, flow[(2 * n + 1)] = INF,
                                          dis[(2 * n + 1)] = 0;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    inq[x] = 0;
    for (int i = head[x], d; i; i = h[i].next) {
      if (dis[d = h[i].node] > dis[x] + h[i].c && h[i].w) {
        dis[d] = dis[x] + h[i].c, pre[d] = i;
        flow[d] = min(flow[x], h[i].w);
        if (!inq[d]) inq[d] = 1, q.push(d);
      }
    }
  }
  return pre[((2 * n + 1) + 1)];
}
void mcmf() {
  int f = 0;
  double c = 0;
  while (spfa()) {
    c += flow[((2 * n + 1) + 1)] * dis[((2 * n + 1) + 1)];
    f += flow[((2 * n + 1) + 1)];
    int x = ((2 * n + 1) + 1);
    while (x != (2 * n + 1)) {
      h[pre[x]].w -= flow[((2 * n + 1) + 1)];
      h[pre[x] ^ 1].w += flow[((2 * n + 1) + 1)];
      x = h[pre[x] ^ 1].node;
    }
  }
  if (f != n - 1)
    puts("-1");
  else
    printf("%.10lf\n", c);
}
struct POINT {
  int x, y;
} P[MX];
double dist(POINT A, POINT B) {
  return sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
}
int main() {
  n = read();
  int mxcnt = 0, mxy = -114514;
  for (int i = 1; i <= n; ++i) {
    P[i].x = read(), P[i].y = read();
    if (P[i].y > mxy) mxcnt = 0, mxy = P[i].y;
    if (P[i].y == mxy) ++mxcnt;
  }
  if (mxcnt > 1) return puts("-1"), 0;
  for (int i = 1; i <= n; ++i) {
    addedge((2 * n + 1), i, 2, 0);
    addedge(i + n, ((2 * n + 1) + 1), 1, 0);
    for (int j = 1; j <= n; ++j) {
      if (P[j].y >= P[i].y) continue;
      addedge(i, j + n, 1, dist(P[i], P[j]));
    }
  }
  mcmf();
  return 0;
}
