#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long INF64 = 2e18;
const long double EPS = 1e-7;
mt19937 myrand(time(NULL));
const int N = 1000 + 13;
const int M = 400 * 1000 + 13;
struct edge {
  int v, u;
  double w;
  int cap, flow;
  edge(){};
  edge(int v, int u, double w, int cap, int flow)
      : v(v), u(u), w(w), cap(cap), flow(flow){};
};
int n, rn;
vector<int> g[N];
int lst;
edge e[M];
int s, t;
pair<int, int> a[N];
int rem(int it) { return e[it].cap - e[it].flow; }
void add_edge(int v, int u, double w, int cap) {
  g[v].push_back(lst);
  e[lst++] = edge(v, u, w, cap, 0);
  g[u].push_back(lst);
  e[lst++] = edge(u, v, -w, 0, 0);
}
bool read() {
  if (scanf("%d", &rn) != 1) return 0;
  lst = 0;
  s = 2 * rn, t = s + 1;
  n = t + 1;
  for (int i = 0; i < (n); i++) g[i].clear();
  for (int i = 0; i < (rn); i++) scanf("%d%d", &a[i].first, &a[i].second);
  return 1;
}
double f[N];
void FB(int v) {
  for (int i = 0; i < (n); i++) f[i] = INF;
  f[v] = 0;
  while (true) {
    bool fl = false;
    for (int i = 0; i < (lst); i++)
      if (f[e[i].u] > f[e[i].v] + e[i].w && rem(i)) {
        f[e[i].u] = f[e[i].v] + e[i].w;
        fl = true;
      }
    if (!fl) break;
  }
}
double d[N];
int pr[N];
void Dijkstra(int v) {
  for (int i = 0; i < (n); i++) {
    d[i] = INF;
    pr[i] = -1;
  }
  d[v] = 0;
  set<pair<double, int> > q;
  q.insert(make_pair(d[v], v));
  while (!q.empty()) {
    auto cur = *q.begin();
    q.erase(q.begin());
    for (auto it : g[cur.second]) {
      int first = e[it].v;
      int second = e[it].u;
      if (d[second] > d[first] + e[it].w && rem(it) != 0) {
        q.erase(make_pair(d[second], second));
        d[second] = d[first] + e[it].w;
        pr[second] = it;
        q.insert(make_pair(d[second], second));
      }
    }
  }
}
int res;
double minc() {
  double ans = 0;
  while (true) {
    Dijkstra(s);
    int cur = t;
    int add = INF;
    double len = 0;
    while (pr[cur] != -1) {
      add = min(add, rem(pr[cur]));
      len += e[pr[cur]].w;
      cur = e[pr[cur]].v;
    }
    if (add == 0 || pr[t] == -1) break;
    cur = t;
    while (pr[cur] != -1) {
      e[pr[cur]].flow += add;
      e[pr[cur] ^ 1].flow -= add;
      cur = e[pr[cur]].v;
    }
    res += add;
    ans += add * len;
  }
  return ans;
}
double get(int i, int j) {
  return sqrtl((a[i].first - a[j].first) * (a[i].first - a[j].first) +
               (a[i].second - a[j].second) * (a[i].second - a[j].second));
}
void solve() {
  for (int i = 0; i < (rn); i++)
    for (int j = 0; j < (rn); j++)
      if (a[i].second > a[j].second) add_edge(i, rn + j, get(i, j), 1);
  for (int i = 0; i < (rn); i++) add_edge(s, i, 0, 2);
  for (int i = 0; i < (rn); i++) add_edge(rn + i, t, 0, 1);
  res = 0;
  double ans = minc();
  if (res != rn - 1) {
    printf("-1\n");
    return;
  }
  printf("%.15f\n", ans);
}
int main() {
  while (read()) solve();
}
