#include <bits/stdc++.h>
using namespace std;
int cap[1000][1000];
double cost[1000][1000];
int fnet[1000][1000], adj[1000][1000], deg[1000];
int par[1000];
double d[1000];
int q[1000], inq[1000], qs;
double pi[1000];
bool dijkstra(int n, int s, int t) {
  for (int i = 0; i < 1000; ++i) d[i] = 1e20;
  memset(par, -1, sizeof(par));
  memset(inq, -1, sizeof(inq));
  d[s] = qs = 0;
  inq[q[qs++] = s] = 0;
  par[s] = n;
  while (qs) {
    int u = q[0];
    inq[u] = -1;
    q[0] = q[--qs];
    if (qs) inq[q[0]] = 0;
    for (int i = 0, j = 2 * i + 1, t; j < qs; i = j, j = 2 * i + 1) {
      if (j + 1 < qs && d[q[j + 1]] < d[q[j]]) j++;
      if (d[q[j]] + 1e-9 >= d[q[i]]) break;
      {
        t = q[i];
        q[i] = q[j];
        q[j] = t;
        t = inq[q[i]];
        inq[q[i]] = inq[q[j]];
        inq[q[j]] = t;
      };
    }
    for (int k = 0, v = adj[u][k]; k < deg[u]; v = adj[u][++k]) {
      if (fnet[v][u] && d[v] > (d[u] + pi[u] - pi[v]) - cost[v][u])
        d[v] = (d[u] + pi[u] - pi[v]) - cost[v][par[v] = u];
      if (fnet[u][v] < cap[u][v] &&
          d[v] - 1e-9 > (d[u] + pi[u] - pi[v]) + cost[u][v])
        d[v] = (d[u] + pi[u] - pi[v]) + cost[par[v] = u][v];
      if (par[v] == u) {
        if (inq[v] < 0) {
          inq[q[qs] = v] = qs;
          qs++;
        }
        for (int i = inq[v], j = (i - 1) / 2, t; d[q[i]] < d[q[j]] - 1e-9;
             i = j, j = (i - 1) / 2) {
          t = q[i];
          q[i] = q[j];
          q[j] = t;
          t = inq[q[i]];
          inq[q[i]] = inq[q[j]];
          inq[q[j]] = t;
        };
      }
    }
  }
  for (int i = 0; i < n; i++)
    if (pi[i] < 1e20) pi[i] += d[i];
  return par[t] >= 0;
}
int mcmf4(int n, int s, int t, double &fcost) {
  memset(deg, 0, sizeof(deg));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (cap[i][j] || cap[j][i]) adj[i][deg[i]++] = j;
  memset(fnet, 0, sizeof(fnet)), memset(pi, 0, sizeof(pi));
  int flow = fcost = 0;
  while (dijkstra(n, s, t)) {
    int bot = (1 << 30);
    for (int v = t, u = par[v]; v != s; u = par[v = u])
      bot = min(bot, fnet[v][u] ? fnet[v][u] : (cap[u][v] - fnet[u][v]));
    for (int v = t, u = par[v]; v != s; u = par[v = u])
      if (fnet[v][u]) {
        fnet[v][u] -= bot;
        fcost -= bot * cost[v][u];
      } else {
        fnet[u][v] += bot;
        fcost += bot * cost[u][v];
      }
    flow += bot;
  }
  return flow;
}
double sqr(double x) { return x * x; }
int x[500], y[500];
int n, second, E;
int main() {
  scanf("%d", &n), second = 0, E = 2 * n + 1;
  for (int i = 1; i <= n; ++i) scanf("%d%d", x + i, y + i);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (y[i] > y[j])
        cap[i][j + n] = 1,
                   cost[i][j + n] = sqrt(sqr(x[i] - x[j]) + sqr(y[i] - y[j]));
  for (int i = 1; i <= n; ++i) cap[second][i] = 2, cap[i + n][E] = 1;
  double ans;
  int flow = mcmf4(E + 1, second, E, ans);
  if (flow != n - 1)
    printf("-1");
  else
    printf("%.10lf", ans);
  return 0;
}
