#include <bits/stdc++.h>
using namespace std;
int n, m;
struct point {
  double x, y, z;
} P[5200];
inline double sqr(double x) { return x * x; }
inline double dist(point a, point b) {
  return sqrt(sqr(a.x - b.x) + sqr(a.y - b.y) + sqr(a.z - b.z));
}
inline double len(point a, point b, point c) {
  return dist(a, b) + dist(a, c) + dist(b, c);
}
int main() {
  cin >> n;
  double ans = 1e100;
  for (int i = 0; i < n; i++) cin >> P[i].x >> P[i].y >> P[i].z;
  for (int i = 1; i < n; i++)
    for (int j = i + 1; j < n; j++) ans = min(ans, len(P[0], P[i], P[j]));
  cout.precision(11);
  cout << ans / 2 << endl;
}
