#include <bits/stdc++.h>
using namespace std;
const int mod = (int)(1e9 + 7);
inline int read() {
  int f = 1, x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  };
  return f * x;
}
inline void print(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) print(x / 10);
  putchar(x % 10 + 48);
}
template <typename T>
bool Chkmax(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T>
bool Chkmin(T &a, T b) {
  return a > b ? a = b, 1 : 0;
}
void add(int &x, int y) { x = ((x % mod) + (y % mod)) % mod; }
void sub(int &x, int y) { x = ((x - y) % mod + mod) % mod; }
void mul(int &x, int y) { x = (long long)(x * y) % mod; }
const int Maxn = 500000 + 10;
int n, m, s, t;
struct Edge {
  int v, w, nxt, flow;
  double cost;
} e[Maxn];
Edge mkn(int v, int w, int nxt, int flow, double cost) {
  Edge x;
  x.v = v;
  x.w = w;
  x.nxt = nxt;
  x.flow = flow;
  x.cost = cost;
  return x;
}
int head[Maxn], Edgecnt = 0;
double dist[Maxn];
int lasts[Maxn], laste[Maxn], mine[Maxn];
bool inq[Maxn];
void Link(int u, int v, int w, double cost) {
  e[Edgecnt] = mkn(v, w, head[u], 0, cost), head[u] = Edgecnt++;
  e[Edgecnt] = mkn(u, 0, head[v], 0, -cost), head[v] = Edgecnt++;
}
bool Spfa() {
  queue<int> q;
  for (int i = s; i <= t; i++) {
    dist[i] = 1e15;
    inq[i] = 0;
    lasts[i] = laste[i] = -1;
    mine[i] = 0x3f3f3f3f;
  }
  q.push(s);
  inq[s] = 1;
  dist[s] = 0;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    inq[u] = false;
    for (int i = head[u]; i != -1; i = e[i].nxt) {
      int v = e[i].v, w = e[i].w, flow = e[i].flow;
      double cost = e[i].cost;
      if (dist[v] > dist[u] + cost && w > flow) {
        lasts[v] = u;
        laste[v] = i;
        mine[v] = min(mine[u], w - flow);
        dist[v] = dist[u] + cost;
        if (!inq[v]) {
          inq[v] = true;
          q.push(v);
        }
      }
    }
  }
  return lasts[t] != -1;
}
int MaxFlow = 0;
double MinCost = 0;
void upd() {
  int p = t;
  while (p != s) {
    e[laste[p]].flow += mine[t];
    e[laste[p] ^ 1].flow -= mine[t];
    p = lasts[p];
  }
  MaxFlow += mine[t];
  MinCost += 1.0 * mine[t] * dist[t];
}
double MCMF() {
  while (Spfa()) upd();
  return MinCost;
}
double x[Maxn], y[Maxn];
double dis(int a, int b) {
  return sqrt((x[a] - x[b]) * (x[a] - x[b]) + (y[a] - y[b]) * (y[a] - y[b]));
}
int main() {
  memset(head, -1, sizeof(head));
  n = read();
  for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];
  s = 0, t = 2 * n + 1;
  for (int i = 1; i <= n; i++) {
    Link(s, i, 2, 0);
    Link(i + n, t, 1, 0);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (y[i] > y[j]) Link(i, j + n, 1, dis(i, j));
    }
  }
  double ans = MCMF();
  if (MaxFlow != n - 1) {
    cout << "-1\n";
    return 0;
  }
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}
