#include <bits/stdc++.h>
using namespace std;
struct edge {
  int from;
  int to;
  int next;
  int flow;
  double cost;
} E[500000 * 2 + 5];
int head[5000 + 5];
int esz = 1;
void add_edge(int u, int v, int w, double c) {
  esz++;
  E[esz].from = u;
  E[esz].to = v;
  E[esz].flow = w;
  E[esz].cost = c;
  E[esz].next = head[u];
  head[u] = esz;
  esz++;
  E[esz].from = v;
  E[esz].to = u;
  E[esz].flow = 0;
  E[esz].cost = -c;
  E[esz].next = head[v];
  head[v] = esz;
}
double dist[5000 + 5];
int minf[5000 + 5];
int last[5000 + 5];
bool inq[5000 + 5];
bool spfa(int s, int t) {
  for (int i = 0; i <= 5000; i++) dist[i] = 0x3f3f3f3f3f3f3f3f;
  memset(minf, 0x3f, sizeof(minf));
  memset(last, 0, sizeof(last));
  queue<int> q;
  q.push(s);
  dist[s] = 0;
  inq[s] = 1;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    inq[x] = 0;
    for (int i = head[x]; i; i = E[i].next) {
      int y = E[i].to;
      if (E[i].flow && dist[y] > dist[x] + E[i].cost) {
        dist[y] = dist[x] + E[i].cost;
        last[y] = i;
        minf[y] = min(minf[x], E[i].flow);
        if (!inq[y]) {
          q.push(y);
          inq[y] = 1;
        }
      }
    }
  }
  return dist[t] != 0x3f3f3f3f3f3f3f3f;
}
void update(int s, int t) {
  int x = t;
  while (x != s) {
    int i = last[x];
    E[i].flow -= minf[t];
    E[i ^ 1].flow += minf[t];
    x = E[i].from;
  }
}
pair<int, double> mcmf(int s, int t) {
  double ans = 0, sum = 0;
  while (spfa(s, t)) {
    ans += dist[t] * minf[t];
    sum += minf[t];
    update(s, t);
  }
  return make_pair(sum, ans);
}
int n;
int x[5000 + 5], y[5000 + 5];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d %d", &x[i], &y[i]);
  int s = 0, t = 2 * n + 1;
  for (int i = 1; i <= n; i++) {
    add_edge(s, i, 2, 0);
    add_edge(i + n, t, 1, 0);
    for (int j = 1; j <= n; j++) {
      if (i != j && y[i] > y[j])
        add_edge(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 = mcmf(s, t);
  if (ans.first != n - 1)
    printf("-1\n");
  else
    printf("%.15lf\n", ans.second);
}
