#include <bits/stdc++.h>
struct node {
  double x, y, z;
} p[5005];
double d[5005];
double getlen(node a, node b) {
  double len;
  len = (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y) +
        (a.z - b.z) * (a.z - b.z);
  return sqrt(len);
}
int main() {
  int n, i, j, a, b, c;
  while (scanf("%d", &n) != EOF) {
    for (i = 0; i < n; i++) {
      scanf("%d %d %d", &a, &b, &c);
      p[i].x = a * 1.0;
      p[i].y = b * 1.0;
      p[i].z = c * 1.0;
    }
    for (i = 1; i < n; i++) {
      d[i] = getlen(p[0], p[i]);
    }
    double lenn;
    double max = 9999999.0;
    for (i = 1; i < n; i++) {
      for (j = 1; j <= i; j++) {
        if (j == i) continue;
        lenn = d[i] + d[j] + getlen(p[i], p[j]);
        if (max - lenn > 1e-6) max = lenn;
      }
    }
    printf("%.10f\n", max * 1.0 / 2.0);
  }
  return 0;
}
