Var
x1,y1,x2,y2,x3,y3,a,b,c,p,s:real;
begin;
readln(x1);
readln(y1);
readln(x2);
readln(y2);
readln(x3);
readln(y3);
a:=sqrt(sqr(x2-x1)+sqr(y2-y1));
b:=sqrt(sqr(x3-x2)+sqr(y3-y2));
c:=sqrt(sqr(x3-x1)+sqr(y3-y1));
p:=a+b+c;
s:=sqrt(p/2*(p/2-a)*(p/2-b)*(p/2-c));
writeln('P=',p);
writeln('S=',s);
end.