#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int ed, flow, next;
  double cost;
} edge[1000010];
int head[1024], nEdge;
double dis[1024];
bool vis[1024];
int que[1024 * 1024 * 2], front, rear;
inline void init() {
  memset(head, -1, sizeof(head));
  nEdge = 0;
}
inline void addEdge(int a, int b, int f, double c) {
  edge[nEdge].ed = b;
  edge[nEdge].flow = f;
  edge[nEdge].cost = c;
  edge[nEdge].next = head[a];
  head[a] = nEdge++;
  edge[nEdge].ed = a;
  edge[nEdge].flow = 0;
  edge[nEdge].cost = -c;
  edge[nEdge].next = head[b];
  head[b] = nEdge++;
}
int dfs(int x, int dst, int pre) {
  int i, y, cur = pre, d;
  if (x == dst) return pre;
  for (vis[x] = true, i = head[x]; ~i; i = edge[i].next) {
    if (edge[i].flow && fabs(edge[i].cost) < 1e-8 && !vis[y = edge[i].ed]) {
      d = dfs(y, dst, min(cur, edge[i].flow));
      edge[i].flow -= d;
      edge[i ^ 1].flow += d;
      if (!(cur -= d)) break;
    }
  }
  if (!cur) vis[x] = false;
  return pre - cur;
}
bool spfa(int v, int src, int dst) {
  int i, x, y;
  fill(dis, dis + v, 1e10);
  memset(vis, 0, sizeof(vis));
  front = rear = v;
  dis[src] = 0;
  vis[que[rear++] = src] = true;
  while (front < rear) {
    vis[x = que[front++]] = false;
    for (i = head[x]; ~i; i = edge[i].next) {
      if (edge[i].flow && dis[y = edge[i].ed] > dis[x] + edge[i].cost) {
        dis[y] = dis[x] + edge[i].cost;
        if (!vis[y]) vis[que[rear++] = y] = true;
      }
    }
  }
  return dis[dst] < 1000000000;
}
int minCostMaxFlow(int v, int src, int dst, double &netCost) {
  int i, x, curFlow, totalFlow = 0;
  double d = 0;
  for (netCost = 0; spfa(v, src, dst);) {
    d += dis[dst];
    for (x = 0; x < v; ++x) {
      for (i = head[x]; ~i; i = edge[i].next) {
        edge[i].cost += dis[x] - dis[edge[i].ed];
      }
    }
    memset(vis, 0, sizeof(vis));
    curFlow = dfs(src, dst, 1000000000);
    totalFlow += curFlow;
    netCost += d * curFlow;
  }
  return totalFlow;
}
struct Point {
  double x, y;
  Point() {}
  Point(double _x, double _y) : x(_x), y(_y) {}
} p[1024];
inline double dist(const Point &a, const Point &b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
int main() {
  int n, v, src, dst, i, j;
  double ans;
  while (~scanf("%d", &n)) {
    init();
    for (i = 0; i < n; ++i) scanf("%lf %lf", &p[i].x, &p[i].y);
    v = 2 * n + 2;
    src = 2 * n;
    dst = 2 * n + 1;
    for (i = 0; i < n; ++i) {
      addEdge(src, ((i) << 1), 2, 0);
      addEdge((((i) << 1) | 1), dst, 1, 0);
      for (j = 0; j < n; ++j) {
        if (p[i].y > p[j].y)
          addEdge(((i) << 1), (((j) << 1) | 1), 1, dist(p[i], p[j]));
      }
    }
    if (minCostMaxFlow(v, src, dst, ans) == n - 1) {
      printf("%.8lf\n", ans);
    } else {
      printf("-1\n");
    }
  }
  return 0;
}
