#include <bits/stdc++.h>
using namespace std;
const int N = 405;
struct edge {
  int x, y, flow, cap, nxt;
  double cost;
};
struct gragh {
  static const int N = 1000, M = N * N * 2;
  int n, m, S, T, lim, fst[N], f[N], a[N], p[N], q[N];
  double d[N];
  edge e[M];
  void init(int _n, int _lim) {
    n = _n, m = 1, lim = _lim;
    memset(fst, 0, sizeof fst);
  }
  void add(int a, int b, int cap, double cost) {
    m++;
    e[m].x = a, e[m].y = b, e[m].cap = cap, e[m].cost = cost, e[m].flow = 0;
    e[m].nxt = fst[a], fst[a] = m;
    m++;
    e[m].x = b, e[m].y = a, e[m].cap = 0, e[m].cost = -cost, e[m].flow = 0;
    e[m].nxt = fst[b], fst[b] = m;
  }
  bool SPFA(int S, int T, int &flow, double &cost) {
    int head = 0, tail = 0, qmod = n + 1, x, y;
    memset(f, 0, sizeof f);
    for (int i = 1; i <= n; i++) d[i] = 1e100;
    d[S] = 0, q[tail = tail % qmod + 1] = S, a[S] = 2e9;
    while (head != tail) {
      f[x = q[head = head % qmod + 1]] = 0;
      for (int i = fst[x]; i; i = e[i].nxt) {
        y = e[i].y;
        if (e[i].flow < e[i].cap && d[x] + e[i].cost < d[y]) {
          d[y] = d[x] + e[i].cost;
          a[y] = min(a[x], e[i].cap - e[i].flow);
          p[y] = i;
          if (!f[y]) f[q[tail = tail % qmod + 1] = y] = 1;
        }
      }
    }
    if (d[T] > 1e90) return 0;
    flow += a[T], cost += d[T] * a[T], x = T;
    for (x = T; x != S; x = e[p[x]].x)
      e[p[x]].flow += a[T], e[p[x] ^ 1].flow -= a[T];
    return 1;
  }
  double MinCost(int S, int T) {
    int flow = 0;
    double cost = 0;
    while (SPFA(S, T, flow, cost))
      ;
    if (flow < lim) return -1;
    return cost;
  }
} g;
int n, x[N], y[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &x[i], &y[i]);
  g.init(n * 2 + 2, n - 1);
  int S = n * 2 + 1, T = n * 2 + 2;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (y[i] > y[j])
        g.add(i, j + n, 1,
              sqrt((x[i] - x[j]) * (x[i] - x[j]) +
                   (y[i] - y[j]) * (y[i] - y[j])));
  for (int i = 1; i <= n; i++) g.add(S, i, 2, 0), g.add(i + n, T, 1, 0);
  double res = g.MinCost(S, T);
  if (res < 0)
    puts("-1");
  else
    printf("%.10lf", res);
  return 0;
}
