from collections import * from itertools import * from functools import * from heapq import * import sys,math input = sys.stdin.readline N = int(input()) px,py,pz = map(float,input().split()) X = [tuple(map(float,input().split())) for _ in range(N)] ans = 0 def plane(A,B,C): #三次元上の点A,B,Cを通る平面ax+by+cz+d=0を求める # return (a,b,c,d) ax,ay,az = A bx,by,bz = B cx,cy,cz = C a = (by-ay)*(cz-az) - (cy-ay)*(bz-az) b = (bz-az)*(cx-ax) - (cz-az)*(bx-ax) c = (bx-ax)*(cy-ay) - (cx-ax)*(by-ay) d = -(a*ax+b*ay+c*az) return (a,b,c,d) for i in range(N-2): xi = X[i] for j in range(i+1,N-1): xj = X[j] for k in range(j+1,N): xk = X[k] a,b,c,d = plane(xi,xj,xk) ans += abs(a*px+b*py+c*pz+d)/math.sqrt(a**2+b**2+c**2) print(ans)