#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  x = 0;
  char ch;
  bool flag = false;
  while (ch = getchar(), ch < '!')
    ;
  if (ch == '-') ch = getchar(), flag = true;
  while (x = 10 * x + ch - '0', ch = getchar(), ch > '!')
    ;
  if (flag) x = -x;
}
inline int cat_max(const int &a, const int &b) { return a > b ? a : b; }
inline int cat_min(const int &a, const int &b) { return a < b ? a : b; }
const int maxn = 410;
const int maxnode = 1024;
const int maxedge = 210010;
const int inf = 0x3f3f3f3f;
const double eps = 1e-9;
struct Edge {
  int to, next, cap;
  double cost;
} G[maxedge << 1];
int head[maxnode], cnt = 1;
void add(int u, int v, int cap, double cost) {
  G[++cnt].to = v;
  G[cnt].next = head[u];
  G[cnt].cap = cap;
  G[cnt].cost = cost;
  head[u] = cnt;
}
inline void insert(int u, int v, int cap, double cost) {
  add(u, v, cap, cost);
  add(v, u, 0, -cost);
}
double dis[maxnode], ans;
int flow[maxnode], q[maxnode + 10], p[maxnode];
int l, r, S, T, num;
bool inq[maxnode];
bool spfa() {
  for (int i = 0; i <= T + 1; ++i) dis[i] = 1e10;
  dis[S] = 0;
  l = 0;
  r = -1;
  q[++r] = S;
  inq[S] = true;
  flow[S] = inf;
  while (l <= r) {
    int u = q[l % maxnode];
    ++l;
    inq[u] = false;
    for (int i = head[u]; i; i = G[i].next) {
      if (dis[G[i].to] > dis[u] + G[i].cost && G[i].cap) {
        dis[G[i].to] = dis[u] + G[i].cost;
        flow[G[i].to] = cat_min(flow[u], G[i].cap);
        p[G[i].to] = i;
        if (!inq[G[i].to]) {
          q[++r % maxnode] = G[i].to;
          inq[G[i].to] = true;
        }
      }
    }
  }
  if (fabs(dis[T] - dis[T + 1]) < eps) return false;
  ans += dis[T] * flow[T];
  num += flow[T];
  for (int u = T; u != S; u = G[p[u] ^ 1].to) {
    G[p[u]].cap -= flow[T], G[p[u] ^ 1].cap += flow[T];
  }
  return true;
}
struct Node {
  int x, y;
  double friend operator^(const Node &a, const Node &b) {
    return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
  }
} a[maxn];
int main() {
  int n;
  read(n);
  S = (n << 1) + 2;
  T = S + 1;
  for (int i = 1; i <= n; ++i) {
    read(a[i].x);
    read(a[i].y);
    insert(i << 1, T, 1, 0);
    insert(S, i << 1 | 1, 2, 0);
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (i == j) continue;
      if (a[i].y > a[j].y) {
        insert(i << 1 | 1, j << 1, 1, a[i] ^ a[j]);
      }
    }
  }
  while (spfa())
    ;
  if (num != n - 1)
    puts("-1");
  else
    printf("%.15lf\n", ans);
  getchar();
  getchar();
  return 0;
}
