#!/usr/bin/env pypy3 import collections import functools import itertools import math import operator # Based on http://thira.plavox.info/blog/2008/06/_c.html def in_place_det(a): n = len(a) for i, j in itertools.product(range(n), repeat=2): if i < j: b = a[j][i] / a[i][i] for k in range(n): a[j][k] -= a[i][k] * b d = functools.reduce(operator.mul, (a[i][i] for i in range(n))) return d class Vector3(collections.namedtuple("Vector3", "x y z")): __slots__ = () def __add__(self, other): return Vector3(*(s + o for s, o in zip(self, other))) def __sub__(self, other): return Vector3(*(s - o for s, o in zip(self, other))) def __mul__(self, other): # cross product return abs(self) * abs(other) * math.sin(self.angle(other)) def __neg__(self): return Vector3(-self.x, -self.y, -self.z) def __pos__(self): return Vector3(+self.x, +self.y, +self.z) def __abs__(self): # norm return math.sqrt(sum(s * s for s in self)) def dotproduct(self, other): return sum(s * o for s, o in zip(self, other)) def angle(self, other): return math.acos(self.dotproduct(other) / abs(self) / abs(other)) def scale(self, k): return Vector3(k * self.x, k * self.y, k * self.z) def volume_of_trigonal_pyramid(p, q1, q2, q3): v1 = q1 - p v2 = q2 - p v3 = q3 - p a = [list(v1), list(v2), list(v3)] return abs(in_place_det(a) / 6) def volume_of_triangle(q1, q2, q3): a = q2 - q1 b = q3 - q1 return abs(a * b) / 2 def dist(p, q1, q2, q3): d = volume_of_trigonal_pyramid(p, q1, q2, q3) * 3 d /= volume_of_triangle(q1, q2, q3) return d def solve(p, qs): return sum(dist(p, *q123) for q123 in itertools.combinations(qs, 3)) def main(): n = int(input()) p = Vector3(*map(float, input().split())) qs = [Vector3(*map(float, input().split())) for _ in range(n)] print("{:.12f}".format(solve(p, qs))) if __name__ == '__main__': main()