#include <bits/stdc++.h>
using namespace std;
const int N = (int)4e2;
struct edge {
  int from, to, cap;
  double cost;
  edge() {}
  edge(int from, int to, int cap, double cost) {
    edge ::from = from;
    edge ::to = to;
    edge ::cap = cap;
    edge ::cost = cost;
  }
};
int s, t, n, vc, x[N], y[N], last_e[N * 2 + 2], last_v[N * 2 + 2],
    clr[N * 2 + 2];
double ans, fi[2 * N + 2], dist[2 * N + 2];
vector<int> g[2 * N + 1];
vector<edge> e;
double weight(int num) { return fi[e[num].from] + e[num].cost - fi[e[num].to]; }
double len(int a, int b) {
  return sqrt(((x[a] - x[b]) * (x[a] - x[b])) +
              ((y[a] - y[b]) * (y[a] - y[b])));
}
void addEdge(int a, int b, int cap, double cost) {
  int n1 = (int)(e).size();
  e.push_back(edge(a, b, cap, cost));
  int n2 = (int)(e).size();
  e.push_back(edge(b, a, 0, -cost));
  g[a].push_back(n1);
  g[b].push_back(n2);
}
void Dijkstra() {
  memset(clr, 0, sizeof(clr));
  memset(dist, 0, sizeof(dist));
  clr[s] = 1;
  for (int iter = 0; iter < vc; iter++) {
    int ind = -1;
    double min_val = -1;
    for (int i = 0; i < vc; i++)
      if (clr[i] == 1 && (ind == -1 || min_val > dist[i])) {
        ind = i;
        min_val = dist[i];
      }
    if (ind == -1) break;
    clr[ind] = 2;
    for (int i = 0; i < (int)(g[ind]).size(); i++) {
      int num = g[ind][i];
      int next = e[num].to;
      if (e[num].cap &&
          (clr[next] == 0 ||
           clr[next] == 1 && dist[next] > dist[ind] + weight(num))) {
        clr[next] = 1;
        dist[next] = dist[ind] + weight(num);
        last_e[next] = num;
        last_v[next] = ind;
      }
    }
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  s = 2 * n, t = 2 * n + 1, vc = 2 * n + 2;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (y[i] < y[j]) addEdge(i, n + j, 1, len(i, j));
  for (int i = 0; i < n; i++) {
    addEdge(s, i, 1, 0);
    addEdge(n + i, t, 2, 0);
  }
  for (int i = 0; i < n - 1; i++) {
    Dijkstra();
    if (!clr[t]) {
      cout << -1 << endl;
      return 0;
    }
    ans += dist[t] + fi[t] - fi[s];
    int cur = t;
    while (cur != s) {
      e[last_e[cur]].cap--;
      e[last_e[cur] ^ 1].cap++;
      cur = last_v[cur];
    }
    for (int i = 0; i < vc; i++) fi[i] += dist[i];
  }
  cout.precision(9);
  cout << fixed << ans << endl;
  return 0;
}
