#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = false;
  while (!isdigit(c)) {
    if (c == '-') flag = true;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  if (flag) x = -x;
}
int n, sum, s, t;
double ans;
int d[2000010];
double dis[2000010];
bool vis[2000010];
struct node {
  int x, y;
} p[2000010];
struct edge {
  int to, nxt, v;
  double c;
} e[2000010];
int head[2000010], edge_cnt = 1;
void add(int from, int to, int val, double cost) {
  e[++edge_cnt] = (edge){to, head[from], val, cost};
  head[from] = edge_cnt;
  e[++edge_cnt] = (edge){from, head[to], 0, -cost};
  head[to] = edge_cnt;
}
bool spfa() {
  queue<int> q;
  for (int i = s; i <= t; ++i) dis[i] = 1000000000, vis[i] = d[i] = 0;
  q.push(s), dis[s] = 0, d[s] = 1, vis[s] = true;
  while (!q.empty()) {
    int x = q.front();
    q.pop(), vis[x] = false;
    for (int i = head[x]; i; i = e[i].nxt) {
      int y = e[i].to, v = e[i].v;
      double c = e[i].c;
      if (v && dis[y] - (dis[x] + c) > 1e-8) {
        dis[y] = dis[x] + c, d[y] = d[x] + 1;
        if (!vis[y]) vis[y] = true, q.push(y);
      }
    }
  }
  return dis[t] != 1000000000;
}
int dfs(int x, int lim) {
  if (x == t) return lim;
  int res = lim, flow;
  for (int i = head[x]; i; i = e[i].nxt) {
    int y = e[i].to, v = e[i].v;
    double c = e[i].c;
    if (!v || fabs(dis[y] - (dis[x] + c)) > 1e-8 || d[y] != d[x] + 1) continue;
    if (flow = dfs(y, min(res, v))) {
      res -= flow;
      e[i].v -= flow;
      e[i ^ 1].v += flow;
      if (!res) break;
    }
  }
  return lim - res;
}
void dinic() {
  int flow;
  while (spfa())
    while (flow = dfs(s, 1000000000)) sum += flow, ans += flow * dis[t];
}
double calc(int x) { return x * x; }
double dist(node a, node b) { return sqrt(calc(a.x - b.x) + calc(a.y - b.y)); }
int main() {
  read(n), t = 2 * n + 1;
  for (int i = 1; i <= n; ++i) {
    read(p[i].x), read(p[i].y);
    add(s, i, 2, 0), add(i + n, t, 1, 0);
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (p[i].y <= p[j].y) continue;
      add(i, j + n, 1, dist(p[i], p[j]));
    }
  }
  dinic();
  if (sum != n - 1)
    puts("-1");
  else
    printf("%.8lf", ans);
  return 0;
}
