#include <bits/stdc++.h>
using namespace std;
const int maxn = 800 + 5;
struct edge {
  int to, nex, w;
  double v;
} e[maxn * maxn * 2];
int head[maxn], cur[maxn], tot = 1;
void add(int a, int b, int c, double d) {
  e[++tot] = (edge){b, head[a], c, d};
  head[a] = cur[a] = tot;
}
void addedge(int a, int b, int c, double d) {
  add(a, b, c, d);
  add(b, a, 0, -d);
}
int n, m, s, t;
double dis[maxn];
bool vis[maxn];
bool spfa() {
  memset(vis, 0, sizeof vis);
  for (int i = s; i <= t; ++i)
    vis[i] = 0, dis[i] = (1ll << 60), cur[i] = head[i];
  queue<int> Q;
  dis[s] = 0;
  vis[s] = 1;
  Q.push(s);
  while (!Q.empty()) {
    int u = Q.front();
    Q.pop();
    vis[u] = 0;
    for (int i = head[u]; i; i = e[i].nex) {
      int v = e[i].to;
      if (e[i].w && dis[v] - dis[u] - e[i].v > 1e-6) {
        dis[v] = dis[u] + e[i].v;
        if (!vis[v]) vis[v] = 1, Q.push(v);
      }
    }
  }
  return dis[t] < (double)(1ll << 60);
}
int dfs(int u, int in) {
  if (u == t) return in;
  int out = 0, tmp;
  vis[u] = 1;
  for (int i = cur[u]; i; i = e[i].nex) {
    int v = e[i].to;
    cur[u] = i;
    if ((!vis[v]) && e[i].w && abs(dis[v] - dis[u] - e[i].v) < 1e-6 &&
        (tmp = dfs(v, min(in, e[i].w)))) {
      e[i].w -= tmp, e[i ^ 1].w += tmp;
      in -= tmp, out += tmp;
      if (!in) break;
    }
  }
  if (!out) dis[u] = 0;
  vis[u] = 0;
  return out;
}
double x[maxn], y[maxn];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> n;
  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) addedge(s, i, 2, 0), addedge(i + n, t, 1, 0);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (i != j && y[i] > y[j])
        addedge(i, j + n, 1,
                sqrt((x[i] - x[j]) * (x[i] - x[j]) +
                     (y[i] - y[j]) * (y[i] - y[j])));
  int ans1 = 0;
  double ans2 = 0;
  while (spfa()) {
    int tmp = dfs(s, 2e9);
    ans2 += dis[t] * tmp;
    ans1 += tmp;
  }
  if (ans1 == n - 1)
    cout << setprecision(6) << fixed << ans2 << '\n';
  else
    cout << -1 << '\n';
  return 0;
}
