#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5, M = 2e5 + 5;
int read() {
  int x = 0, f = 1;
  char ch;
  while (!isdigit(ch = getchar())) (ch == '-') && (f = -f);
  for (x = ch ^ 48; isdigit(ch = getchar());
       x = (x << 3) + (x << 1) + (ch ^ 48))
    ;
  return x * f;
}
double res, dis[N], cost[M];
struct node {
  double x, y;
} a[N];
int n, m, s, t, ans, cnt = 1, val[M], pre[M], vis[N], head[N], to[M], nxt[M];
void add(int u, int v, int w, double c) {
  to[++cnt] = v;
  val[cnt] = w;
  cost[cnt] = c;
  nxt[cnt] = head[u];
  head[u] = cnt;
  to[++cnt] = u;
  val[cnt] = 0;
  cost[cnt] = -c;
  nxt[cnt] = head[v];
  head[v] = cnt;
}
double Dis(int i, int j) {
  return sqrt((a[i].x - a[j].x) * (a[i].x - a[j].x) +
              (a[i].y - a[j].y) * (a[i].y - a[j].y));
}
bool spfa() {
  queue<int> q;
  q.push(s);
  for (int i = s; i <= t; ++i) vis[i] = 0, dis[i] = 2e9;
  vis[s] = 1;
  dis[s] = 0;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    vis[x] = false;
    for (int i = head[x]; i; i = nxt[i]) {
      if (val[i] && dis[to[i]] > dis[x] + cost[i]) {
        pre[to[i]] = i;
        dis[to[i]] = dis[x] + cost[i];
        if (vis[to[i]] == 0) q.push(to[i]), vis[to[i]] = true;
      }
    }
  }
  return dis[t] != 2e9;
}
void mcmf() {
  while (spfa()) {
    int up = 2e9;
    for (int p = t; p != s; p = to[pre[p] ^ 1]) up = min(up, val[pre[p]]);
    for (int p = t; p != s; p = to[pre[p] ^ 1]) {
      val[pre[p]] -= up;
      val[pre[p] ^ 1] += up;
    }
    res += up * dis[t];
    ans += up;
  }
}
int main() {
  n = read();
  s = 0;
  t = 2 * n + 1;
  for (int i = 1; i <= n; ++i) {
    scanf("%lf%lf", &a[i].x, &a[i].y);
    add(s, i * 2 - 1, 2, 0);
    add(i * 2, t, 1, 0);
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (i != j && a[i].y > a[j].y) add(i * 2 - 1, j * 2, 1, Dis(i, j));
    }
  }
  mcmf();
  if (ans == n - 1)
    printf("%f\n", res);
  else
    puts("-1");
  return 0;
}
