#include <bits/stdc++.h>
using namespace std;
struct ed {
  int to, c, f;
  double cost;
} edge[1010101];
struct pt {
  int x, y;
  bool operator<(struct pt g) const { return y < g.y; }
} ponto[858];
int n, seen[858], p[858], curr, s, t, flow;
double dist[858], ans;
vector<int> adj[858];
void add_edge(int a, int b, int c, double cost) {
  edge[curr].to = b;
  edge[curr].c = c;
  edge[curr].f = 0;
  edge[curr].cost = cost;
  adj[a].push_back(curr++);
  edge[curr].to = a;
  edge[curr].c = 0;
  edge[curr].f = 0;
  edge[curr].cost = -cost;
  adj[b].push_back(curr++);
}
double dist_(int i, int j) {
  return hypot(ponto[i].x * 1.0 - ponto[j].x * 1.0,
               ponto[i].y * 1.0 - ponto[j].y * 1.0);
}
void build_graph() {
  s = curr = 0;
  t = 858 - 2;
  for (int i = 0; i < 858; i++) adj[i].clear();
  for (int i = 1; i <= n; i++) {
    add_edge(s, i + n, 2, 0);
    add_edge(i, t, 1, 0);
    for (int j = 1; j <= n; j++) {
      if (ponto[j].y < ponto[i].y) {
        add_edge(i + n, j, 1, dist_(i, j));
      }
    }
  }
}
void augment() {
  int mf = 101010100;
  for (int u = t, e = p[u]; u != s; u = edge[e ^ 1].to, e = p[u]) {
    mf = min(mf, edge[e].c - edge[e].f);
  }
  flow += mf;
  for (int u = t, e = p[u]; u != s; u = edge[e ^ 1].to, e = p[u]) {
    ans += mf * edge[e].cost;
    edge[e].f += mf;
    edge[e ^ 1].f -= mf;
  }
}
bool SPF() {
  memset(seen, 0, sizeof seen);
  for (int i = 0; i < 858; i++) dist[i] = 101010100;
  dist[s] = 0.0;
  seen[s] = 1;
  queue<int> q;
  q.push(s);
  p[s] = p[t] = -1;
  while (q.size()) {
    int u = q.front();
    q.pop();
    seen[u] = 0;
    for (int i = 0; i < adj[u].size(); i++) {
      int e = adj[u][i];
      int v = edge[e].to;
      int w = edge[e].c - edge[e].f;
      if (w > 0 && dist[v] > dist[u] + edge[e].cost) {
        dist[v] = dist[u] + edge[e].cost;
        if (!seen[v]) {
          seen[v] = 1;
          q.push(v);
        }
        p[v] = e;
      }
    }
  }
  if (p[t] == -1) return false;
  augment();
  return true;
}
double MCMF() {
  ans = 0.0;
  flow = 0;
  while (SPF())
    ;
  if (flow == n - 1) return ans;
  return -1;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &ponto[i].x, &ponto[i].y);
  }
  build_graph();
  double a = MCMF();
  if (a < 0)
    printf("-1\n");
  else
    printf("%.8lf\n", a);
}
