#define f(x,y)(x[j]-x[k])*(y[i]-y[k])-(y[j]-y[k])*(x[i]-x[k]), double x[301],y[301],z[301],p,q,r,s;i,k;main(j){for(gets(&p);~scanf("%lf%lf%lf",x+i,y+i,z+i)?++i:k?k--,p=f(y,z)q=f(z,x)r=f(x,y)s+=fabs(p*(*x-x[k])+q*(*y-y[k])+r*(*z-z[k]))/sqrt(p*p+q*q+r*r):(k=--j)?:(j=--i););printf("%f",s);}