#include <bits/stdc++.h>
using namespace std;
double ans = 10000000000000;
struct node {
  int x, y, z;
};
node q[5000 + 10];
int main() {
  int n;
  cin >> n;
  int i, j;
  for (i = 1; i <= n; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    q[i].x = a;
    q[i].y = b;
    q[i].z = c;
  }
  for (i = 2; i <= n; i++) {
    for (j = i + 1; j <= n; j++) {
      if (i == j) continue;
      double t = sqrt((q[i].x - q[1].x) * (q[i].x - q[1].x) +
                      (q[i].y - q[1].y) * (q[i].y - q[1].y) +
                      (q[i].z - q[1].z) * (q[i].z - q[1].z)) +
                 sqrt((q[j].x - q[1].x) * (q[j].x - q[1].x) +
                      (q[j].y - q[1].y) * (q[j].y - q[1].y) +
                      (q[j].z - q[1].z) * (q[j].z - q[1].z)) +
                 sqrt((q[i].x - q[j].x) * (q[i].x - q[j].x) +
                      (q[i].y - q[j].y) * (q[i].y - q[j].y) +
                      (q[i].z - q[j].z) * (q[i].z - q[j].z));
      if (t * 0.5 < ans) ans = t * 0.5;
    }
  }
  printf("%.12lf\n", ans);
  return 0;
}
