import sys input = sys.stdin.readline sys.setrecursionlimit(10 ** 7) def dot(x, y, z, xx, yy, zz): return x*xx + y*yy + z*zz def cross(x, y, z, xx, yy, zz): cx = y*zz-z*yy cy = z*xx-x*zz cz = x*yy-y*xx return cx, cy, cz def convert(n): a, b = n.split(".") return int("".join([a, b])) func = convert N = int(input()) P = tuple(map(func, input().rstrip().split())) Q = tuple(tuple(map(func, input().rstrip().split())) for _ in range(N)) ans = 0 for i in range(N-2): ax, ay, az = Q[i] for j in range(i+1, N-1): bx, by, bz = Q[j] X = (bx-ax, by-ay, bz-az) for k in range(j+1, N): cx, cy, cz = Q[k] Y = (cx-ax, cy-ay, cz-az) D = cross(*X, *Y) dist = abs(D[0]*P[0] + D[1]*P[1] + D[2]*P[2] - dot(*D, *Q[k])) dist /= dot(*D, *D) ** 0.5 ans += dist print("{:.20f}".format(ans * 1e-6))