#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
template <class T>
inline void gn(T &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
template <class T>
inline void print(T first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
int N, first[1100], second[1100];
double cost[1100][1100], dis[1100], C;
int adj[1100][1100], deg[1100], cap[1100][1100], pre[1100];
int q[1100 * 10], qf, qb, src, tar;
double cal(int i, int j) {
  return sqrt((double)(first[i] - first[j]) * (first[i] - first[j]) +
              (double)(second[i] - second[j]) * (second[i] - second[j]));
}
void init() {
  memset(pre, -1, sizeof(pre));
  src = 0;
  tar = 2 * N + 1;
}
void add_edge(int u, int v, int c, double w) {
  adj[u][deg[u]++] = v;
  adj[v][deg[v]++] = u;
  cap[u][v] = c;
  cap[v][u] = 0;
  cost[u][v] = w;
  cost[v][u] = -w;
}
int mincost_maxflow() {
  int ans = 0, bot;
  while (1) {
    for (int i = 0; i <= 2 * N + 1; i++) dis[i] = 1e8;
    qf = qb = 0;
    dis[src] = 0;
    q[qb++] = src;
    while (qf < qb) {
      int u = q[qf++];
      for (int i = 0; i < deg[u]; i++) {
        int v = adj[u][i];
        if (cap[u][v] == 0) continue;
        if (dis[v] - dis[u] - cost[u][v] > 1e-8) {
          dis[v] = dis[u] + cost[u][v];
          q[qb++] = v;
          pre[v] = u;
        }
      }
    }
    if (dis[tar] >= 1e8) return ans;
    bot = 0x3f3f3f3f;
    for (int u = tar; u != src; u = pre[u]) bot = min(bot, cap[pre[u]][u]);
    for (int u = tar; u != src; u = pre[u]) {
      cap[pre[u]][u] -= bot;
      cap[u][pre[u]] += bot;
    }
    C += dis[tar];
    ans += bot;
  }
  return ans;
}
int main() {
  gn(N);
  for (int i = 1; i <= N; i++) {
    gn(first[i]);
    gn(second[i]);
  }
  init();
  for (int i = 1; i <= N; i++) {
    add_edge(src, i, 2, 0);
    add_edge(i + N, tar, 1, 0);
    for (int j = 1; j <= N; j++) {
      if (1e-8 < second[i] - second[j]) add_edge(i, j + N, 1, cal(i, j));
    }
  }
  if (mincost_maxflow() < N - 1)
    puts("-1");
  else
    printf("%.10lf\n", C);
  return 0;
}
