#include <bits/stdc++.h>
using namespace std;
int n, m, sumf, x, y, k, t, des, det, nume;
int vis[1111], q[1111 * 1111], pre[1111], fro[1111];
long double ans, dist[1111], oo;
struct node {
  int next, y, f;
  long double c;
} z[1111 * 1111 + 1111];
struct point {
  int x, y;
} a[1111];
int sqr(int x) { return x * x; }
long double calc(int x, int y) {
  return sqrt(sqr(a[x].x - a[y].x) + sqr(a[x].y - a[y].y));
}
void fill(long double x[], long double y) {
  for (int i = 0; i <= det; i++) x[i] = y;
}
bool check(long double x) { return (abs(x) < 1e-7); }
bool spfa() {
  fill(dist, oo);
  dist[des] = 0;
  vis[des] = 1;
  q[1] = des;
  int ff = 1;
  int rr = 1;
  while (ff <= rr) {
    int k = q[ff++];
    vis[k] = 0;
    for (int p = z[k].next; p; p = z[p].next) {
      int t = z[p].y;
      if (z[p].f && dist[k] + z[p].c < dist[t]) {
        dist[t] = dist[k] + z[p].c;
        if (!vis[t]) {
          q[++rr] = t;
          vis[t] = rr;
        }
        if (dist[t] < dist[q[ff]]) {
          vis[q[ff]] = vis[t];
          swap(q[ff], q[vis[t]]);
          vis[t] = ff;
        }
        fro[t] = k;
        pre[t] = p;
      }
    }
  }
  return !check(dist[det] - oo);
}
void aug() {
  int flow = 1 << 30;
  for (int k = det; k != des; k = fro[k]) flow = min(flow, z[pre[k]].f);
  sumf += flow;
  for (int k = det; k != des; k = fro[k]) {
    ans += flow * z[pre[k]].c;
    z[pre[k]].f -= flow;
    z[pre[k] ^ 1].f += flow;
  }
}
void link(int x, int y, int flow, long double cost) {
  nume++;
  z[nume].next = z[x].next;
  z[x].next = nume;
  z[nume].y = y;
  z[nume].f = flow;
  z[nume].c = cost;
  nume++;
  z[nume].next = z[y].next;
  z[y].next = nume;
  z[nume].y = x;
  z[nume].f = 0;
  z[nume].c = -cost;
}
int main() {
  scanf("%d", &n);
  oo = 1ll << 60;
  memset(vis, 0, sizeof(vis));
  memset(z, 0, sizeof(z));
  for (int i = 0; i < n; i++) scanf("%d%d", &a[i].x, &a[i].y);
  des = n * 2;
  det = des + 1;
  sumf = 0;
  ans = 0;
  nume = det + 1;
  if (!(nume & 1)) nume++;
  for (int i = 0; i < n; i++) {
    link(des, i, 2, 0);
    link(n + i, det, 1, 0);
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (a[j].y < a[i].y) link(i, n + j, 1, calc(i, j));
  while (spfa()) aug();
  if (sumf == n - 1)
    printf("%.10f\n", (double)ans);
  else
    printf("-1\n");
  return 0;
}
