#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int s = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    s = (s << 3) + (s << 1) + ch - '0', ch = getchar();
  return s * f;
}
const int N = 805, M = N * N + N;
const double inf = 1e12;
struct Edge {
  int to, next, flow;
  double cost;
} e[M << 1];
int head[N], ecnt = 1;
inline void adde(int u, int v, int flow, double cost) {
  e[++ecnt] = (Edge){v, head[u], flow, cost};
  head[u] = ecnt;
  e[++ecnt] = (Edge){u, head[v], 0, -cost};
  head[v] = ecnt;
}
int s, t, n, m;
double dis[N];
bool vis[N];
queue<int> q;
int pre_edge[N], pre_node[N], flow[N];
bool SPFA() {
  for (int i = 1; i <= t; ++i) dis[i] = inf + inf;
  memset(vis, 0, sizeof(vis));
  dis[s] = 0;
  flow[s] = INT_MAX;
  q.push(s);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    vis[u] = 0;
    for (int i = head[u]; i; i = e[i].next) {
      int v = e[i].to;
      if (!e[i].flow) continue;
      if (dis[v] > dis[u] + e[i].cost) {
        dis[v] = dis[u] + e[i].cost;
        flow[v] = min(flow[u], e[i].flow);
        pre_node[v] = u;
        pre_edge[v] = i;
        if (!vis[v]) {
          vis[v] = 1;
          q.push(v);
        }
      }
    }
  }
  return dis[t] < inf;
}
void MCMF(int &maxflow, double &mincost) {
  maxflow = 0;
  mincost = 0;
  while (SPFA()) {
    int cur = t, f = flow[t];
    double c = dis[t];
    maxflow += f;
    mincost += c * (1.0 * f);
    while (cur != s) {
      e[pre_edge[cur]].flow -= f;
      e[pre_edge[cur] ^ 1].flow += f;
      cur = pre_node[cur];
    }
  }
}
int x[N], y[N];
inline double dist(int i, int j) {
  return sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
}
int main() {
  int flow = 0;
  double cost = 0;
  n = read();
  s = n + n + 1, t = n + n + 2;
  for (int i = 1; i <= n; ++i) x[i] = read(), y[i] = read();
  for (int i = 1; i <= n; ++i) {
    adde(s, i, 2, 0);
    adde(i + n, t, 1, 0);
    for (int j = 1; j <= n; ++j)
      if (y[i] > y[j]) adde(i, j + n, 1, dist(i, j));
  }
  MCMF(flow, cost);
  if (flow != n - 1)
    puts("-1");
  else
    printf("%.8lf", cost);
  return 0;
}
