#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const int oo = ~0u >> 2, mo = (int)1e9 + 7;
const int mn = 5100;
struct po {
  int x, y, z;
} p[mn];
int n;
double Ans(1e100);
double dis(const po &a, const po &b) {
  return sqrt(((a.x - b.x) * (a.x - b.x)) + ((a.y - b.y) * (a.y - b.y)) +
              ((a.z - b.z) * (a.z - b.z)));
}
double len(const po &a, const po &b, const po &c) {
  return dis(a, b) + dis(a, c) + dis(b, c);
}
int main() {
  cin >> n;
  for (int i = (1); i <= (n); ++i) cin >> p[i].x >> p[i].y >> p[i].z;
  for (int i = (2); i <= (n); ++i)
    for (int j = (i + 1); j <= (n); ++j)
      (Ans = min(Ans, len(p[1], p[i], p[j])));
  cout << fixed << setprecision(10) << Ans / 2 << endl;
}
