#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using pii = pair<int, int>;
using vi = vector<int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vlli = vector<long long int>;
using vpii = vector<pair<int, int>>;
struct Edge {
  int from, to, capacity;
  long double cost;
};
vector<vector<int>> adj, capacity;
vector<vector<long double>> cost;
const int INF = 1e9;
void shortest_paths(int n, int v0, vector<long double>& d, vector<int>& p) {
  d.assign(n, INF);
  d[v0] = 0;
  vector<bool> inq(n, false);
  queue<int> q;
  q.push(v0);
  p.assign(n, -1);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    inq[u] = false;
    for (int v : adj[u]) {
      if (capacity[u][v] > 0 && d[v] > d[u] + cost[u][v]) {
        d[v] = d[u] + cost[u][v];
        p[v] = u;
        if (!inq[v]) {
          inq[v] = true;
          q.push(v);
        }
      }
    }
  }
}
void min_cost_flow(int N, vector<Edge> edges, int K, int s, int t) {
  adj.assign(N, vector<int>());
  cost.assign(N, vector<long double>(N, 0));
  capacity.assign(N, vector<int>(N, 0));
  for (Edge e : edges) {
    adj[e.from].push_back(e.to);
    adj[e.to].push_back(e.from);
    cost[e.from][e.to] = e.cost;
    cost[e.to][e.from] = -e.cost;
    capacity[e.from][e.to] = e.capacity;
  }
  int flow = 0;
  double cost = 0;
  vector<long double> d;
  vector<int> p;
  while (flow < K) {
    shortest_paths(N, s, d, p);
    if (d[t] == INF) break;
    int f = K - flow;
    int cur = t;
    while (cur != s) {
      f = min(f, capacity[p[cur]][cur]);
      cur = p[cur];
    }
    flow += f;
    cost += f * d[t];
    cur = t;
    while (cur != s) {
      capacity[p[cur]][cur] -= f;
      capacity[cur][p[cur]] += f;
      cur = p[cur];
    }
  }
  if (flow == K)
    cout << fixed << setprecision(12) << cost;
  else
    cout << -1;
}
vector<Edge> edges;
void addedge(int u, int v, int cap, long double cost) {
  Edge e;
  e.from = u;
  e.to = v;
  e.capacity = cap;
  e.cost = cost;
  edges.push_back(e);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, N, E, source, sink;
  long double x[500], y[500];
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (y[i] > y[j])
        addedge(i, n + j, 1,
                sqrt((x[i] - x[j]) * (x[i] - x[j]) +
                     (y[i] - y[j]) * (y[i] - y[j])));
  for (int i = 1; i <= n; i++)
    addedge(0, i, 2, 0), addedge(n + i, n + n + 1, 1, 0);
  min_cost_flow(n + n + 2, edges, n - 1, 0, n + n + 1);
}
