#include <bits/stdc++.h>
using namespace std;
void bug() { cout << " " << endl; }
template <class T>
void bug(T a) {
  cout << a << "  ";
}
template <class T>
void bug(T* a, int n) {
  for (int i = 0; i < (n); i++) bug(a[i]);
}
struct edge {
  int u, v, next, c;
  double dis;
};
const int maxm = 2100000, maxn = 1100;
double oo = 1e200;
struct Graph {
  edge e[maxm];
  int size, n, S, T, Flow, g[maxn];
  double Cost;
  Graph() {
    size = 1;
    Cost = 0;
  }
  inline void add(int a, int b, int c, double d) {
    e[++size] = (edge){a, b, g[a], c, d};
    g[a] = size;
    e[++size] = (edge){b, a, g[b], 0, -d};
    g[b] = size;
  }
  int q[1000000], tail, head, in[maxn];
  double d[maxn];
  int fr[maxn];
  int spfa() {
    head = tail = 0;
    q[tail++] = S;
    for (int i = 0; i <= n; i++) d[i] = oo;
    d[S] = 0;
    while (head < tail) {
      int m = q[head++];
      in[m] = 0;
      for (int p = g[m]; p; p = e[p].next)
        if (e[p].c > 0 && d[e[p].v] > d[m] + e[p].dis) {
          d[e[p].v] = d[m] + e[p].dis;
          fr[e[p].v] = p;
          if (!in[e[p].v]) {
            q[tail++] = e[p].v;
            in[e[p].v] = 1;
          }
        }
    }
    return d[T] < oo;
  }
  void aug() {
    int flow = 100000000;
    for (int u = T; u != S; u = e[fr[u]].u) flow = min(flow, e[fr[u]].c);
    Flow += flow;
    Cost += flow * d[T];
    for (int u = T; u != S; u = e[fr[u]].u) {
      e[fr[u]].c -= flow;
      e[fr[u] ^ 1].c += flow;
    }
  }
  void CostFlow() {
    while (spfa()) aug();
  }
} G;
int n;
pair<int, int> p[1111];
int in[1111], out[1111];
double dist(pair<int, int> a, pair<int, int> b) {
  long long x = a.first - b.first, y = a.second - b.second;
  return sqrt(x * x + y * y);
}
int main() {
  cin >> n;
  for (int i = 0; i < (n); i++) cin >> p[i].second >> p[i].first;
  sort(p, p + n);
  reverse(p, p + n);
  if (p[0].first == p[1].first) {
    cout << -1 << endl;
    return 0;
  }
  G.n = 2 * n + 2;
  G.S = 2 * n + 1;
  G.T = 2 * n + 2;
  for (int i = 0; i < (n); i++) out[i] = 1 + i;
  for (int i = 0; i < (n); i++) in[i] = n + 1 + i;
  for (int i = 0; i < (n); i++) G.add(G.S, out[i], 2, 0);
  for (int i = 0; i < (n); i++)
    if (i > 0) G.add(in[i], G.T, 1, 0);
  for (int i = 0; i < (n); i++)
    for (int j = 0; j < (n); j++)
      if (p[i].first > p[j].first) G.add(out[i], in[j], 1, dist(p[i], p[j]));
  G.CostFlow();
  if (G.Flow < n - 1) {
    cout << "-1" << endl;
    return 0;
  } else {
    cout << fixed << setprecision(16);
    cout << G.Cost << endl;
  }
  return 0;
}
