#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool Up(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool Down(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
inline int getus() {
  int tmp, c;
  while (tmp = fgetc(stdin), tmp < '0' || tmp > '9')
    ;
  tmp -= '0';
  while (c = fgetc(stdin), '0' <= c && c <= '9') tmp = tmp * 10 + c - '0';
  return tmp;
}
inline int getint() {
  int tmp, c, flag;
  while (flag = fgetc(stdin), flag != '-' && (flag < '0' || flag > '9'))
    ;
  if (flag == '-')
    tmp = 0;
  else
    tmp = flag - '0';
  while (c = fgetc(stdin), '0' <= c && c <= '9') tmp = tmp * 10 + c - '0';
  return flag == '-' ? -tmp : tmp;
}
struct Vec {
  int x, y;
} P[513];
namespace Heap {
pair<double, int> base[330022];
int size;
inline bool cmp(const pair<double, int> &a, const pair<double, int> &b) {
  return a > b;
}
void push(double a, int b) {
  base[++size] = make_pair(a, b);
  push_heap(base + 1, base + size + 1, cmp);
}
void pop() {
  pop_heap(base + 1, base + size + 1, cmp);
  --size;
}
}  // namespace Heap
int N, tot, S, T, pe[1025];
int c[1025][1025];
double w[1025][1025], dist[1025];
double cost(0.0);
int main() {
  N = getus();
  S = 0;
  T = 2 * N + 1;
  tot = 2 * N;
  memset(w, 63, sizeof(w));
  for (int i = (1); i <= (N); ++i) {
    P[i].x = getint();
    P[i].y = getint();
    c[S][i] = 1;
    c[i + N][T] = 2;
    w[S][i] = 0;
    w[i + N][T] = 0;
  }
  for (int x = (1); x <= (N); ++x)
    for (int y = (1); y <= (N); ++y)
      if (P[x].y < P[y].y) {
        w[x][y + N] = hypot(P[x].x - P[y].x, P[x].y - P[y].y);
        w[y + N][x] = -w[x][y + N];
        c[x][y + N] = 1;
      }
  for (int restFlow = N - 1; restFlow--;) {
    for (int i = (S); i <= (T); ++i) dist[i] = 1000000000;
    Heap::size = 0;
    for (Heap::push(dist[S] = 0, S); Heap::size;) {
      int x = Heap::base[1].second, b, e;
      double d = Heap::base[1].first;
      Heap::pop();
      if (d != dist[x]) continue;
      if (1 <= x && x <= N)
        b = N + 1, e = N + N;
      else if (N <= x && x <= N + N) {
        b = 1, e = N;
        if (c[x][T] && Down(dist[T], dist[x])) {
          Heap::push(dist[T], T);
          pe[T] = x;
        }
      } else if (x == 0)
        b = 1, e = N;
      else
        b = N + 1, e = N + N;
      for (int y = b; y <= e; ++y)
        if (c[x][y])
          if (Down(dist[y], dist[x] + w[x][y])) {
            Heap::push(dist[y], y);
            pe[y] = x;
          }
    }
    if (dist[T] >= 1000000000) {
      puts("-1");
      return 0;
    }
    cost += dist[T];
    for (int x = T, y; x != S; x = y) {
      y = pe[x];
      --c[y][x];
      ++c[x][y];
    }
  }
  printf("%.8f\n", cost);
  return 0;
}
