#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int st, en, cap, flow, next;
  double cost;
  Edge() {}
  Edge(int a, int b, int c, double d, int e) {
    st = a, en = b, cap = c, cost = d, next = e, flow = 0;
  }
} edge[1000000];
int head[900], tot, now[900], pre[900];
int source, sink, FLOW, n;
double dis[900];
queue<int> q;
bool vs[900];
struct data {
  double x, y;
  bool operator<(const data &a) const {
    if (y == a.y)
      return x < a.x;
    else
      return y > a.y;
  }
} vertex[900];
void add_edge(int st, int en, int cap, double cost) {
  edge[tot] = Edge(st, en, cap, cost, head[st]);
  head[st] = tot++;
  edge[tot] = Edge(en, st, 0, -cost, head[en]);
  head[en] = tot++;
}
bool SPFA() {
  for (int i = source; i <= sink; i++)
    dis[i] = 0x3fffffff, vs[i] = false, now[i] = -1;
  while (!q.empty()) q.pop();
  q.push(source), dis[source] = 0, vs[source] = true;
  while (!q.empty()) {
    int u = q.front();
    q.pop(), vs[u] = 0;
    for (int i = head[u], v; i != -1; i = edge[i].next)
      if (edge[i].cap - edge[i].flow > 0 &&
          dis[v = edge[i].en] > dis[u] + edge[i].cost) {
        dis[v] = dis[u] + edge[i].cost, now[v] = i;
        if (!vs[v]) vs[v] = 1, q.push(v);
      }
  }
  if (dis[sink] != 0x3fffffff)
    return true;
  else
    return false;
}
double MCMF() {
  double cost = 0;
  FLOW = 0;
  while (SPFA()) {
    int flow = 0x3fffffff;
    for (int u = sink; u != source; u = edge[now[u]].st)
      if (flow > edge[now[u]].cap - edge[now[u]].flow)
        flow = edge[now[u]].cap - edge[now[u]].flow;
    for (int u = sink; u != source; u = edge[now[u]].st) {
      edge[now[u]].flow += flow;
      edge[now[u] ^ 1].flow -= flow;
    }
    cost += flow * dis[sink];
    FLOW += flow;
  }
  return cost;
}
double cal_dis(int a, int b) {
  return sqrt((vertex[a].x - vertex[b].x) * (vertex[a].x - vertex[b].x) +
              (vertex[a].y - vertex[b].y) * (vertex[a].y - vertex[b].y));
}
void build(int n) {
  tot = 0, source = 0, sink = n + n + 1;
  for (int i = source; i <= sink; i++) head[i] = -1;
  for (int i = 1; i <= n; i++)
    add_edge(source, i, 2, 0), add_edge(i + n, sink, 1, 0);
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      if (vertex[i].y == vertex[j].y) continue;
      add_edge(i, j + n, 1, cal_dis(i, j));
    }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf%lf", &vertex[i].x, &vertex[i].y);
  sort(vertex + 1, vertex + n + 1);
  build(n);
  double ans = MCMF();
  if (FLOW != n - 1)
    printf("-1\n");
  else
    printf("%lf\n", ans);
  return 0;
}
