#include <bits/stdc++.h>
namespace IO {
char buf[1000000], *p1, *p2;
inline char getc() {
  if (p1 == p2) p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin);
  return p1 == p2 ? EOF : *(p1++);
}
template <typename tp>
inline void r(tp &n) {
  n = 0;
  char c = getc();
  int f = 1;
  while (!isdigit(c) && c != '-') c = getc();
  if (c == '-') f = -1, c = getc();
  while (isdigit(c)) n = n * 10 + c - 48, c = getc();
  n *= f;
}
template <typename tp>
inline void w(tp n) {
  if (n / 10) w(n / 10);
  putchar(n % 10 + 48);
}
};  // namespace IO
using namespace IO;
const int N = 1e3, M = 2e5, INF = 1e9;
using namespace std;
struct Node {
  double x, y;
} p[N];
int n, S, T, ans, num = 1;
int inq[N], pre[N], incf[N];
int head[N], nt[M << 1], to[M << 1], cap[M << 1];
double cost, dis[N], val[M << 1];
queue<int> q;
bool SPFA() {
  for (int i = 0; i <= T; ++i) inq[i] = 0, dis[i] = DBL_MAX;
  dis[S] = 0;
  incf[S] = INF;
  q.push(S);
  inq[S] = 1;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i = head[u]; i; i = nt[i]) {
      int v = to[i];
      if (!cap[i]) continue;
      if (dis[v] > dis[u] + val[i]) {
        dis[v] = dis[u] + val[i];
        incf[v] = min(incf[u], cap[i]);
        pre[v] = i;
        if (!inq[v]) q.push(v);
      }
    }
    inq[u] = 0;
  }
  return dis[T] != DBL_MAX;
}
void update() {
  int x = T, y;
  while (x != S)
    y = pre[x], cap[y] -= incf[T], cap[y ^ 1] += incf[T], x = to[y ^ 1];
  ans += incf[T], cost += 1ll * incf[T] * dis[T];
}
void Add(int x, int y, int z, double w) {
  ++num;
  nt[num] = head[x];
  head[x] = num;
  to[num] = y;
  cap[num] = z;
  val[num] = w;
  ++num;
  nt[num] = head[y];
  head[y] = num;
  to[num] = x;
  cap[num] = 0;
  val[num] = -w;
}
double DIS(int a, int b) {
  return sqrt(((p[a].x - p[b].x) * (p[a].x - p[b].x)) +
              ((p[a].y - p[b].y) * (p[a].y - p[b].y)));
}
int main() {
  r(n);
  S = 0, T = n + n + 1;
  for (int i = 1; i <= n; ++i)
    r(p[i].x), r(p[i].y), Add(i, T, 1, 0), Add(S, i + n, 2, 0);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (p[j].y < p[i].y) Add(i + n, j, 1, DIS(i, j));
  while (SPFA()) update();
  if (ans != n - 1)
    puts("-1");
  else
    printf("%.10lf", cost);
  return 0;
}
