#include <bits/stdc++.h>
using namespace std;
const int maxn = 810;
double lx[maxn], ly[maxn];
double slk[maxn];
int visx[maxn], visy[maxn];
int n;
pair<int, int> a[maxn];
double dis[maxn][maxn];
int link[maxn];
const double inf = 2 * (1e9);
const double eps = 1e-6;
inline double abss(double x) {
  if (x > 0) return x;
  return -x;
}
inline bool dfs(int x) {
  visx[x] = 1;
  for (int i = 1; i <= n; i++) {
    if (visy[i]) continue;
    double d = lx[x] + ly[i] - dis[x][i];
    if (d < eps) {
      visy[i] = 1;
      if (link[i] == -1 || dfs(link[i])) {
        link[i] = x;
        return true;
      }
    } else {
      slk[i] = min(slk[i], d);
    }
  }
  return false;
}
inline void km() {
  for (int i = 1; i <= n; i++) {
    lx[i] = -inf;
    ly[i] = 0;
    for (int j = 1; j <= n; j++) {
      lx[i] = max(lx[i], dis[i][j]);
    }
  }
  memset(link, -1, sizeof(link));
  for (int i = 1; i <= n; i++) {
    while (1) {
      memset(visx, 0, sizeof(visx));
      memset(visy, 0, sizeof(visy));
      for (int j = 1; j <= n; j++) {
        slk[j] = inf;
      }
      if (dfs(i)) break;
      double d = inf;
      for (int j = 1; j <= n; j++) {
        if (visy[j] == 0) d = min(d, slk[j]);
      }
      for (int j = 1; j <= n; j++) {
        if (visx[j]) lx[j] -= d;
        if (visy[j]) ly[j] += d;
      }
    }
  }
  double ans = 0;
  int res = 0;
  for (int i = 1; i <= n; i++) {
    if (dis[link[i]][i] > -1e9) {
      res++;
      ans += dis[link[i]][i];
    }
  }
  if (res == (n - 2) / 2) {
    printf("%.10lf\n", -ans);
  } else {
    printf("-1\n");
  }
}
inline int sqr(int x) { return x * x; }
inline double dist(int x1, int y1, int x2, int y2) {
  return sqrt(sqr(x1 - x2) * 1.0 + sqr(y1 - y2) * 1.0);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &a[i].first, &a[i].second);
  }
  for (int i = 1; i <= n * 2; i++) {
    for (int j = 1; j <= n * 2; j++) {
      dis[i][j] = -inf;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (a[i].second <= a[j].second) continue;
      dis[i * 2 - 1][j] =
          -dist(a[i].first, a[i].second, a[j].first, a[j].second);
      dis[i * 2][j] = -dist(a[i].first, a[i].second, a[j].first, a[j].second);
    }
  }
  n *= 2;
  km();
  return 0;
}
