#include <bits/stdc++.h>
using namespace std;
struct Line {
  int nxt, t, c;
  double l;
} l[165500];
int fir[850], tl = 1;
void adl(int f, int t, int c, double cost) {
  l[++tl] = (Line){fir[f], t, c, cost};
  fir[f] = tl;
  l[++tl] = (Line){fir[t], f, 0, -cost};
  fir[t] = tl;
}
int S, T, pre[850], lp[850], flow[850];
bool in[850];
double dis[850];
queue<int> t;
int spfa() {
  for (int i = 1; i <= T; i++) {
    dis[i] = 1e16;
    flow[i] = 0;
  }
  flow[S] = 10000000;
  dis[S] = 0;
  t.push(S);
  in[S] = 1;
  while (!t.empty()) {
    int u = t.front();
    in[u] = 0;
    t.pop();
    for (int i = fir[u], v; i; i = l[i].nxt)
      if (l[i].c && dis[v = l[i].t] > dis[u] + l[i].l) {
        dis[v] = dis[u] + l[i].l;
        flow[v] = min(flow[u], l[i].c);
        lp[v] = i;
        pre[v] = u;
        if (!in[v]) {
          in[v] = 1;
          t.push(v);
        }
      }
  }
  return flow[T];
}
struct Point {
  int x, y;
} p[405];
bool cmp(const Point &A, const Point &B) { return A.y > B.y; }
double len(Point A, Point B) {
  return sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
}
int n;
int main() {
  scanf("%d", &n);
  S = n + n + 1;
  T = S + 1;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &p[i].x, &p[i].y);
    adl(S, i + n, 2, 0);
    adl(i, T, 1, 0);
  }
  sort(p + 1, p + n + 1, cmp);
  adl(S, 1, 1, 0);
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++)
      if (p[i].y > p[j].y) adl(i + n, j, 1, len(p[i], p[j]));
  int d, ans = 0;
  double cans = 0;
  while (d = spfa()) {
    int u = T;
    while (u != S) {
      int last = pre[u];
      l[lp[u]].c -= d;
      l[lp[u] ^ 1].c += d;
      u = last;
    }
    ans += d;
    cans += d * dis[T];
  }
  if (ans != n)
    puts("-1");
  else
    printf("%.8lf\n", cans);
  return 0;
}
