#include <bits/stdc++.h>
using namespace std;
const double eps = 0.000000000000001;
const int N = 1010;
int n;
pair<int, int> X[N];
const int inf = (1 << 28);
int cap[900][900], flow[900][900];
double wt[900][900], dis[900], totc = 0;
int vis[900], par[900];
long long pbfs(int s, int d) {
  priority_queue<pair<double, int>, vector<pair<double, int> >,
                 greater<pair<double, int> > >
      pq;
  int i;
  for (i = 0; i <= n; i++) {
    dis[i] = inf;
    vis[i] = 0;
  }
  dis[s] = 0;
  pq.push(make_pair(0, s));
  par[s] = par[d] = -1;
  while (!pq.empty()) {
    pair<int, int> cur = pq.top();
    pq.pop();
    int c = cur.second;
    if (vis[c]) continue;
    if (c == d) break;
    vis[c] = 1;
    for (i = 0; i <= n; i++) {
      if (vis[i] == 0 && cap[c][i] - flow[c][i] > 0 &&
          dis[i] > dis[c] + wt[c][i]) {
        dis[i] = dis[c] + wt[c][i];
        par[i] = c;
        pq.push(make_pair(dis[i], i));
      }
    }
  }
  if (par[d] == -1) {
    return 0;
  }
  int x = d, mn = inf;
  while (x != s) {
    int p = par[x];
    mn = min(mn, (int)(cap[p][x] - flow[p][x]));
    x = p;
  }
  x = d;
  while (x != s) {
    int p = par[x];
    flow[p][x] += mn;
    flow[x][p] -= mn;
    x = p;
  }
  totc += mn * dis[d];
  assert(mn < inf);
  return mn;
}
long long mincflow(int s, int d) {
  long long ret = 0, got = 0;
  while ((got = pbfs(s, d)) > 0) {
    ret += got;
  }
  return ret;
}
inline double dist(pair<int, int> a, pair<int, int> b) {
  return sqrt((a.first - b.first) * (a.first - b.first) +
              (a.second - b.second) * (a.second - b.second));
}
int main() {
  int n;
  scanf("%d", &n);
  int i, j;
  for (i = 1; i <= n; i++) scanf("%d%d", &X[i].first, &X[i].second);
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if (X[i].second > X[j].second) {
        cap[j][i + n] = 1;
        wt[j][i + n] = dist(X[i], X[j]);
        wt[i + n][j] = -wt[j][i + n];
      }
    }
  }
  ::n = 2 * n + 2;
  for (i = 1; i <= n; i++) {
    cap[0][i] = 1;
    cap[i + n][2 * n + 1] = 2;
  }
  int ans = mincflow(0, 2 * n + 1);
  if (ans != n - 1) {
    printf("-1\n");
    return 0;
  }
  printf("%.15lf\n", ((double)totc));
  return 0;
}
