#include <bits/stdc++.h>
using namespace std;
const int N = 400;
const double INF = 1e10;
const double EPS = 1e-9;
const int V = N * 2 + 2;
const int MAXE = V * V;
struct Edge {
  int cap, nxt, to;
  double cost;
};
class minCostMaxFlow {
 public:
  Edge E[MAXE];
  int edges, head[V], bak[V], bake[V];
  double dis[V];
  bool vis[V];
  void init() {
    edges = 0;
    memset(head, -1, sizeof(head));
  }
  void add_edge(int u, int v, double w, int c) {
    E[edges] = (Edge){c, head[u], v, w};
    E[edges + 1] = (Edge){0, head[v], u, -w};
    head[u] = edges;
    head[v] = edges + 1;
    edges += 2;
  }
  double sol(int source, int target) {
    double answer = 0;
    while (true) {
      for (int i = 0; i <= target; ++i) {
        vis[i] = 0, dis[i] = INF;
      }
      queue<int> q;
      vis[source] = 1;
      dis[source] = 0;
      q.push(source);
      memset(bak, -1, sizeof(bak));
      memset(bake, -1, sizeof(bake));
      while (!q.empty()) {
        int u = q.front();
        q.pop();
        vis[u] = 0;
        for (int i = head[u]; i != -1;) {
          Edge &e = E[i];
          int v = e.to;
          if (e.cap > 0 && dis[u] + e.cost + EPS < dis[v]) {
            dis[v] = dis[u] + e.cost;
            bak[v] = u;
            bake[v] = i;
            if (!vis[v]) {
              vis[v] = 1;
              q.push(v);
            }
          }
          i = e.nxt;
        }
      }
      if (bak[target] == -1) break;
      answer += dis[target];
      for (int i = target; i != source; i = bak[i]) {
        E[bake[i]].cap -= 1;
        E[bake[i] ^ 1].cap += 1;
      }
    }
    return answer;
  }
  bool check(int n, int root, int target) {
    for (int i = 0; i < n; ++i)
      if (i != root) {
        int u = i + n;
        for (int j = head[u]; j != -1;) {
          Edge &e = E[j];
          if (e.to == target) {
            if (e.cap > 0) return 0;
          }
          j = e.nxt;
        }
      }
    return 1;
  }
};
int n, x[N], y[N];
minCostMaxFlow sol;
double dist(int u, int v) {
  double dx = x[u] - x[v], dy = y[u] - y[v];
  return sqrt(dx * dx + dy * dy);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", x + i, y + i);
  }
  int root_id = max_element(y, y + n) - y;
  int source = n << 1, target = n << 1 | 1;
  sol.init();
  for (int i = 0; i < n; ++i) {
    sol.add_edge(source, i, 0, 2);
    sol.add_edge(i + n, target, 0, 1);
  }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j)
      if (y[i] > y[j]) {
        sol.add_edge(i, j + n, dist(i, j), 1);
      }
  double answer = sol.sol(source, target);
  if (!sol.check(n, root_id, target)) {
    printf("-1");
    return 0;
  }
  printf("%.10f", answer);
  return 0;
}
