#include <bits/stdc++.h>
#pragma GCC optimize("O2,unroll-loops")
using namespace std;
const int inf = 1000000010;
const long long INF = 10000000000000010LL;
const int mod = 1000000007;
const int MAXN = 410, FN = 2 * MAXN, FM = MAXN * MAXN / 2;
int n, m, k, u, v, x, y, t, a, b;
int X[MAXN], Y[MAXN];
int to[FM << 1], prv[FM << 1], cap[FM << 1], M;
int head[FN], Q[FN * 50], par[FN], inq[FN], L, R;
long double dist[FN], cost[FM << 1], ans;
inline void add_edge(int u, int v, int c, long double w) {
  to[M] = v, cap[M] = c, cost[M] = w, prv[M] = head[u], head[u] = M++;
  to[M] = u, cap[M] = 0, cost[M] = -w, prv[M] = head[v], head[v] = M++;
}
bool Flow(int src, int snk) {
  fill(dist, dist + FN, inf);
  L = R = 0;
  dist[Q[R++] = src] = 0;
  inq[src] = 1;
  bool res = 0;
  while (L ^ R) {
    int v = Q[L++];
    res |= (v == snk);
    inq[v] = 0;
    for (int i = head[v]; ~i; i = prv[i])
      if (cap[i]) {
        int u = to[i];
        if (dist[u] > 1e-7 + dist[v] + cost[i]) {
          dist[u] = dist[v] + cost[i];
          par[u] = i;
          if (!inq[u]) {
            inq[u] = 1;
            Q[R++] = u;
          }
        }
      }
  }
  if (!res) return 0;
  ans += dist[snk];
  int v = snk, shit = 0;
  while (v ^ src) {
    int i = par[v];
    cap[i]--;
    cap[i ^ 1]++;
    v = to[i ^ 1];
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  memset(head, -1, sizeof(head));
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> X[i] >> Y[i];
    add_edge(0, i << 1, 1, 0);
    add_edge(i << 1 | 1, 1, 2, 0);
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (Y[i] < Y[j]) {
        long double dx = X[i] - X[j], dy = Y[i] - Y[j],
                    d = sqrt(dx * dx + dy * dy);
        add_edge(i << 1, j << 1 | 1, 1, d);
      }
  for (int i = 1; i < n; i++)
    if (!Flow(0, 1)) return cout << -1 << '\n', 0;
  cout << setprecision(12) << fixed << ans << "\n";
  return 0;
}
