#include <bits/stdc++.h>
using namespace std;
struct cow {
  int v, w, next;
  double c;
} E[500009];
int head[1009];
double dis[1009];
int flow[1009], pre[1009], last[1009];
bool vis[1009];
int cnt = 1;
void add(int u, int v, int w, double c) {
  cnt++;
  E[cnt].v = v;
  E[cnt].w = w;
  E[cnt].c = c;
  E[cnt].next = head[u];
  head[u] = cnt;
  cnt++;
  E[cnt].v = u;
  E[cnt].w = 0;
  E[cnt].c = -c;
  E[cnt].next = head[v];
  head[v] = cnt;
}
queue<int> Q;
bool Spfa(int s, int t) {
  for (int i = 1; i <= t; i++) dis[i] = INT_MAX;
  Q.push(s);
  vis[s] = true;
  dis[s] = 0;
  flow[s] = 1000000009;
  pre[t] = -1;
  while (!Q.empty()) {
    int u = Q.front();
    Q.pop();
    vis[u] = false;
    for (int i = head[u]; i; i = E[i].next) {
      int v = E[i].v;
      if (E[i].w > 0 && dis[v] > dis[u] + E[i].c) {
        dis[v] = dis[u] + E[i].c;
        pre[v] = u;
        last[v] = i;
        flow[v] = min(flow[u], E[i].w);
        if (!vis[v]) {
          vis[v] = true;
          Q.push(v);
        }
      }
    }
  }
  return pre[t] != -1;
}
int maxflow = 0;
double mincost = 0;
void MCMF(int s, int t) {
  while (Spfa(s, t)) {
    int now = t;
    maxflow += flow[t];
    mincost += dis[t] * flow[t];
    while (now != s) {
      E[last[now]].w -= flow[t];
      E[last[now] ^ 1].w += flow[t];
      now = pre[now];
    }
  }
}
int n, s, t, ss;
double x[1009], y[1009];
double get_dis(int a, int b) {
  double X = x[a] - x[b];
  double Y = y[a] - y[b];
  return sqrt(X * X + Y * Y);
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
    x[i]++;
    y[i]++;
  }
  s = 801;
  t = 802;
  for (int i = 1; i <= n; i++) {
    add(s, i, 2, 0);
    add(i + n, t, 1, 0);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (y[i] > y[j]) {
        add(i, j + n, 1, get_dis(i, j));
      }
    }
  }
  MCMF(s, t);
  if (maxflow == n - 1)
    printf("%0.15lf\n", mincost);
  else
    printf("-1\n");
  return 0;
}
