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 for i in range(N-2): ax,ay,az = X[i] for j in range(i+1,N-1): bx,by,bz = X[j] for k in range(j+1,N): cx,cy,cz = X[k] 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) ans += abs(a*px+b*py+c*pz+d)/math.sqrt(a**2+b**2+c**2) print(ans)