# 点と平面の距離 N = int(input()) P = tuple(map(lambda x:float(x),input().split())) lsXYZ = [tuple(map(lambda x:float(x),input().split())) for i in range(N)] def point_to_plane(A,B,C): AB = (B[0]-A[0],B[1]-A[1],B[2]-A[2]) AC = (C[0]-A[0],C[1]-A[1],C[2]-A[2]) outer = (AB[1]*AC[2]-AB[2]*AC[1],AB[2]*AC[0]-AB[0]*AC[2],AB[0]*AC[1]-AB[1]*AC[0]) return outer[0],outer[1],outer[2],-outer[0]*A[0]-outer[1]*A[1]-outer[2]*A[2] def dist_point_plane(P,a,b,c,d): return abs(a*P[0]+b*P[1]+c*P[2]+d)/((a**2+b**2+c**2)**(1/2)) ans = 0 for i in range(N-2): for j in range(i+1,N-1): for k in range(j+1,N): a,b,c,d = point_to_plane(lsXYZ[i],lsXYZ[j],lsXYZ[k]) ans += dist_point_plane(P,a,b,c,d) print(ans)