#include <bits/stdc++.h>
using namespace std;
struct Point {
  int x, y;
};
struct Edge {
  int to, cap;
  double cost;
  int next;
};
Edge E[340000];
int head[1050], ne = 1;
int NV;
inline void addEdge(int from, int to, int cap, double cost) {
  E[++ne] = {to, cap, cost, head[from]}, head[from] = ne;
  E[++ne] = {from, 0, -cost, head[to]}, head[to] = ne;
}
inline double sq(const double x) { return x * x; }
inline double dis(const Point& a, const Point& b) {
  return sqrt(sq(a.x - b.x) + sq(a.y - b.y));
}
double d[1050];
int p[1050];
bool inqueue[1050];
pair<int, double> mcmf(int S, int T) {
  int f = 0;
  double c = 0;
  while (1) {
    for (int i = 0; i < NV; ++i) d[i] = 1e18;
    queue<int> Q;
    Q.push(S);
    d[S] = 0;
    while (!Q.empty()) {
      auto v = Q.front();
      Q.pop();
      inqueue[v] = 0;
      for (int x = head[v]; x; x = E[x].next) {
        int &u = E[x].to, &cap = E[x].cap;
        double& cost = E[x].cost;
        if (cap > 0 and d[v] + cost + 1e-9 < d[u]) {
          d[u] = d[v] + cost;
          p[u] = x;
          if (!inqueue[u]) Q.push(u), inqueue[u] = 1;
        }
      }
    }
    if (d[T] >= 1e17) break;
    int df = 1e9;
    for (int i = T; i != S; i = E[p[i] ^ 1].to) df = min(df, E[p[i]].cap);
    for (int i = T; i != S; i = E[p[i] ^ 1].to)
      E[p[i]].cap -= df, E[p[i] ^ 1].cap += df;
    f += df, c += df * d[T];
  }
  return {f, c};
}
Point P[405];
int n;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed;
  cout.precision(15);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> P[i].x >> P[i].y;
  NV = n + n + 2;
  int S = 0, T = n + n + 1;
  for (int i = 1; i <= n; ++i) addEdge(S, i, 1, 0), addEdge(i + n, T, 2, 0);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (P[i].y < P[j].y) addEdge(i, j + n, 1, dis(P[i], P[j]));
  auto ans = mcmf(S, T);
  if (ans.first < n - 1)
    cout << -1 << endl;
  else
    cout << ans.second << endl;
  return 0;
}
