#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
};
struct Edge {
  int u, v, cap, x;
  double cost;
} E[300005];
int e, l[10005];
inline void init() {
  e = 0;
  memset(l, -1, sizeof(l));
}
inline void insert(int u, int v, int cap, double cost) {
  E[e].u = u;
  E[e].v = v;
  E[e].cap = cap;
  E[e].cost = cost;
  E[e].x = l[u];
  l[u] = e++;
  E[e].u = v;
  E[e].v = u;
  E[e].cap = 0;
  E[e].cost = -cost;
  E[e].x = l[v];
  l[v] = e++;
}
int q[20 * 10005], s, t, inq[10005], eid[10005];
double dis[10005];
void min_cost_max_flow(int src, int sink, int &cap, double &cost) {
  cost = cap = 0;
  while (true) {
    for (int i = 0; i < 10005; i++) dis[i] = 0x3fffffff;
    s = t = 0;
    q[t++] = src;
    inq[src] = 1;
    dis[src] = 0;
    while (s < t) {
      int u = q[s++];
      inq[u] = 0;
      for (int p = l[u]; p >= 0; p = E[p].x) {
        if (E[p].cap <= 0) continue;
        int v = E[p].v;
        if (dis[v] > dis[u] + E[p].cost) {
          dis[v] = dis[u] + E[p].cost;
          eid[v] = p;
          if (inq[v] == 0) {
            inq[v] = 1;
            q[t++] = v;
          }
        }
      }
    }
    if (dis[sink] >= 0x3fffffff) return;
    int c = 0x3fffffff;
    for (int i = sink; i != src; i = E[eid[i]].u) c = min(c, E[eid[i]].cap);
    cost += dis[sink] * (double)c;
    cap += c;
    for (int i = sink; i != src; i = E[eid[i]].u) {
      int p = eid[i];
      E[p].cap -= c;
      E[p ^ 1].cap += c;
    }
  }
}
double GetDist(Point a, Point b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
int main() {
  int n;
  scanf("%d", &n);
  vector<Point> points;
  for (int i = 0; i < n; i++) {
    Point temp;
    scanf("%d%d", &temp.x, &temp.y);
    points.push_back(temp);
  }
  init();
  for (int i = 0; i < n; i++) {
    insert(0, 1 + i, 2, 0);
    insert(n + 1 + i, n + n + 1, 1, 0);
    for (int j = 0; j < n; j++)
      if (points[i].y > points[j].y) {
        insert(1 + i, n + 1 + j, 1, GetDist(points[i], points[j]));
      }
  }
  int cap = 0;
  double cost = 0;
  min_cost_max_flow(0, n + n + 1, cap, cost);
  if (cap < n - 1) {
    printf("-1\n");
  } else {
    printf("%.6f\n", cost);
  }
  return 0;
}
