#include <bits/stdc++.h>
using namespace std;
const long double INF = 1e9;
const int N = 805;
int x[N], y[N], c[N][N], f[N][N], from[N];
vector<int> g[N];
long double d[N][N], dist[N];
bool was[N];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  int s = n * 2, t = n * 2 + 1;
  for (int i = 0; i < n; i++) {
    int num = i * 2;
    g[s].push_back(num);
    g[num].push_back(s);
    c[s][num] = 2;
    g[num + 1].push_back(t);
    g[t].push_back(num + 1);
    c[num + 1][t] = 1;
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (y[i] > y[j]) {
        int v1 = i * 2, v2 = j * 2 + 1;
        g[v1].push_back(v2);
        g[v2].push_back(v1);
        c[v1][v2] = 1;
        d[v1][v2] = sqrt(double(((y[i] - y[j]) * (y[i] - y[j])) +
                                ((x[i] - x[j]) * (x[i] - x[j]))));
        d[v2][v1] = -d[v1][v2];
      }
    }
  long double ans = 0;
  int cnt = 0;
  for (;;) {
    for (int i = 0; i <= t; i++) dist[i] = INF, was[i] = 0;
    dist[s] = 0;
    was[s] = 1;
    bool upd;
    for (int i = 0; i < t; i++) {
      upd = 0;
      for (int j = 0; j <= t; j++) {
        if (!was[j]) continue;
        for (int k = 0; k < (int)(g[j]).size(); k++) {
          int to = g[j][k];
          if (dist[to] > dist[j] + d[j][to] && f[j][to] < c[j][to]) {
            dist[to] = dist[j] + d[j][to];
            from[to] = j;
            upd = 1;
            was[to] = 1;
          }
        }
      }
      if (!upd) break;
    }
    if (dist[t] == INF) break;
    cnt++;
    int now = t;
    while (now != s) {
      int v = from[now];
      f[v][now]++;
      f[now][v]--;
      ans += d[v][now];
      now = v;
    }
  }
  if (cnt == n - 1) {
    cout.precision(6);
    cout << fixed << ans << endl;
  } else
    cout << -1 << endl;
  return 0;
}
