#include <bits/stdc++.h>
using namespace std;
vector<pair<pair<int, int>, pair<int, double> > > edge;
int anti[9 * (int)(805) * (int)(805)];
vector<int> arr[(int)(805)];
int i, j, k, n, m, x, y, z;
pair<int, int> A[(int)(805)];
int source, sink, wh[(int)(805)];
double ans;
int ok, mn, H[(int)(805)], mn2, ans2, q[(int)(805) * 300];
double H2[(int)(805)], pot[(int)(805)];
double dist(pair<int, int> x, pair<int, int> y) {
  return sqrt((x.first - y.first) * (x.first - y.first) +
              (x.second - y.second) * (x.second - y.second));
}
void add_edge(int x, int y, int cap, double cost) {
  int s = edge.size();
  anti[s] = s + 1;
  anti[s + 1] = s;
  edge.push_back(make_pair(make_pair(x, y), make_pair(cap, cost)));
  edge.push_back(make_pair(make_pair(y, x), make_pair(0, -cost)));
  arr[x].push_back(s);
  arr[y].push_back(s + 1);
}
void reverse_edges() {
  int x = sink, p = 1000000007;
  while (x != source) {
    if (wh[x] == -1) return;
    int y = edge[wh[x]].first.first;
    p = min(edge[wh[x]].second.first, p);
    x = y;
  }
  x = sink;
  while (x != source) {
    if (wh[x] == -1) return;
    int y = edge[wh[x]].first.first;
    ans += p * edge[wh[x]].second.second;
    edge[anti[wh[x]]].second.first += p;
    edge[wh[x]].second.first -= p;
    x = y;
  }
  ans2 += p;
}
void ford() {
  memset(wh, -1, sizeof wh);
  for (i = 1; i <= 2 * n + 2; i++) H2[i] = 1e20;
  H2[source] = 0;
  memset(H, 0, sizeof H);
  int s = 0;
  priority_queue<pair<double, int> > xx;
  xx.push(make_pair(0, source));
  while (xx.size()) {
    int x = xx.top().second;
    xx.pop();
    if (H[x]) continue;
    H[x] = 1;
    for (int i = (int)arr[x].size() - 1; i >= 0; i--) {
      int t = arr[x][i];
      int y = edge[t].first.second;
      double cost = edge[t].second.second;
      if (edge[t].second.first > 0 and
          H2[y] > H2[x] + cost + pot[x] - pot[y] and !H[y]) {
        H2[y] = H2[x] + cost + pot[x] - pot[y];
        wh[y] = t;
        xx.push(make_pair(-H2[y], y));
      }
    }
  }
  for (i = 1; i <= 2 * n + 2; i++) pot[i] += H2[i];
}
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> A[i].second >> A[i].first;
  }
  sort(A + 1, A + 1 + n);
  reverse(A + 1, A + 1 + n);
  source = 2 * n + 1;
  sink = 2 * n + 2;
  for (i = 1; i <= n; i++) {
    add_edge(source, i, 2, 0);
    add_edge(i + n, sink, 1, 0);
    for (j = i + 1; j <= n; j++)
      if (A[i].first > A[j].first) add_edge(i, j + n, 1, dist(A[i], A[j]));
  }
  while (1) {
    mn2 = 1000000007;
    ford();
    if (H2[sink] >= 1e20 - 0.00000001) break;
    reverse_edges();
    ans2 += mn;
  }
  if (ans2 == n - 1) {
    cout << setprecision(10) << fixed << ans << '\n';
  } else
    puts("-1");
}
