#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2000015;
const int MOD = 1000000007;
struct MinCostMaxFlow {
  int N;
  vector<vector<int> > G;
  vector<vector<long long int> > cap, flow;
  vector<vector<double> > cost;
  vector<double> dist;
  vector<int> found;
  vector<int> dad;
  MinCostMaxFlow(int N)
      : N(N),
        G(N),
        cap(N, vector<long long int>(N)),
        flow(N, vector<long long int>(N)),
        cost(N, vector<double>(N)),
        found(N),
        dist(N),
        dad(N) {}
  void add_edge(int from, int to, long long int capacity, double c) {
    G[from].push_back(to);
    G[to].push_back(from);
    cap[from][to] = capacity;
    cap[to][from] = 0;
    cost[from][to] = c;
    cost[to][from] = -1 * c;
  }
  bool relax_edge(int u, int v) {
    if (dist[u] + cost[u][v] < dist[v]) {
      dad[v] = u;
      dist[v] = dist[u] + cost[u][v];
      return true;
    }
    return false;
  }
  bool bellmanford(int s, int t) {
    int u, v;
    fill(dad.begin(), dad.end(), -1);
    fill(dist.begin(), dist.end(), (double)1e9);
    fill(found.begin(), found.end(), 0);
    queue<int> Q;
    dad[s] = s;
    dist[s] = 0.0;
    Q.push(s);
    found[s] = true;
    while (!Q.empty()) {
      u = Q.front();
      found[u] = false;
      Q.pop();
      if (u == t) continue;
      for (int i = 0; i <= ((int)(G[u].size())) - 1; i++) {
        v = G[u][i];
        if (cap[u][v] <= flow[u][v]) continue;
        if (relax_edge(u, v) and !found[v]) Q.push(v), found[v] = true;
      }
    }
    return (dad[t] != -1);
  }
  pair<long long int, double> GetMaxFlow(int s, int t) {
    long long int totflow = 0;
    double totcost = 0.0;
    while (bellmanford(s, t)) {
      for (int x = t; x != s; x = dad[x]) {
        flow[dad[x]][x]++;
        flow[x][dad[x]]--;
      }
      totflow++;
      totcost += dist[t];
    }
    return make_pair(totflow, totcost);
  }
};
vector<pair<int, int> > P;
double getdist(int i, int j) {
  return sqrt((P[i].first - P[j].first) * (P[i].first - P[j].first) +
              (P[i].second - P[j].second) * (P[i].second - P[j].second));
}
int main() {
  int n, x, y;
  scanf("%d", &n);
  MinCostMaxFlow F(2 * n + 2);
  int source = 0;
  int sink = 2 * n + 1;
  int ma = -1;
  for (int i = 0; i <= n - 1; i++) {
    scanf("%d", &x), scanf("%d", &y);
    P.push_back(pair<int, int>(x, y));
    ma = max(y, ma);
  }
  int c = 0;
  for (int i = 0; i <= n - 1; i++) {
    if (P[i].second == ma) c++;
  }
  if (c != 1) {
    cout << -1 << "\n";
    return 0;
  }
  for (int i = 0; i <= n - 1; i++) {
    F.add_edge(source, i + 1, 2, 0.0);
    F.add_edge(n + 1 + i, sink, 1, 0.0);
  }
  for (int i = 0; i <= n - 1; i++)
    for (int j = 0; j <= n - 1; j++) {
      if (P[i].second > P[j].second) {
        F.add_edge(i + 1, n + j + 1, 1, getdist(i, j));
      }
    }
  pair<long long int, double> ans = F.GetMaxFlow(source, sink);
  if (ans.first != n - 1)
    cout << -1 << "\n";
  else
    printf("%0.10lf\n", ans.second);
  return 0;
}
