#include <bits/stdc++.h>
using namespace std;
const int maxn = 900;
struct edge {
  int v, w, b;
  double c;
};
vector<edge> adj[maxn];
int n, k;
int s, t;
double dis[maxn];
int bk[maxn], bki[maxn];
bool inq[maxn];
long long x[maxn], y[maxn];
inline void ae(int u, int v, int w, double c) {
  edge nu, nv;
  nu.v = v;
  nu.w = w;
  nu.c = c;
  nu.b = adj[v].size();
  nv.v = u;
  nv.w = 0;
  nv.c = -c;
  nv.b = adj[u].size();
  adj[u].push_back(nu);
  adj[v].push_back(nv);
}
inline pair<int, double> spfa() {
  for (int i = 0; i < maxn; i++) dis[i] = 1e30;
  memset(inq, 0, sizeof(inq));
  dis[s] = 0;
  queue<int> q;
  q.push(s);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    inq[u] = 0;
    for (int i = adj[u].size() - 1; i >= 0; i--) {
      int v = adj[u][i].v;
      int w = adj[u][i].w;
      double c = adj[u][i].c;
      if (dis[u] + c < dis[v] && w != 0) {
        dis[v] = dis[u] + c;
        bk[v] = u;
        bki[v] = i;
        if (!inq[v]) {
          q.push(v);
          inq[v] = 1;
        }
      }
    }
  }
  if (dis[t] > 1e20) return make_pair(-1, 0.0);
  int cur = t;
  int flw = 0x3f3f3f3f;
  while (cur != s) {
    flw = min(flw, adj[bk[cur]][bki[cur]].w);
    cur = bk[cur];
  }
  cur = t;
  double cst = 0;
  while (cur != s) {
    adj[bk[cur]][bki[cur]].w -= flw;
    adj[cur][adj[bk[cur]][bki[cur]].b].w += flw;
    cst += flw * adj[bk[cur]][bki[cur]].c;
    cur = bk[cur];
  }
  return make_pair(flw, cst);
}
inline pair<int, double> ek() {
  pair<int, double> ans = make_pair(0ll, 0.0);
  while (1) {
    pair<int, double> cr = spfa();
    if (cr.first <= 0) return ans;
    ans.first += cr.first;
    ans.second += cr.second;
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
  }
  s = n + n + 1;
  t = n + n + 3;
  for (int i = 1; i <= n; i++) {
    ae(s, i, 2, 0.0);
    ae(i + n, t, 1, 0.0);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      if (y[i] > y[j])
        ae(i, j + n, 1,
           sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j])));
    }
  }
  pair<int, double> ans = ek();
  if (ans.first != n - 1)
    cout << -1;
  else
    printf("%.15lf", ans.second);
  return 0;
}
