function Len(x1,y1, x2, y2:real):real;
begin
Len := sqrt( sqr(x1 - x2) + sqr(y1 - y2) );
end;
var
x1,x2,x3,x4,x5, y1, y2, y3, y4, y5:real;
begin
write('x1 = '); readln(x1);
write('y1 = '); readln(y1);
write('x2 = '); readln(x2);
write('y2 = '); readln(y2);
write('x3 = '); readln(x3);
write('y3 = '); readln(y3);
write('x4 = '); readln(x4);
write('y4 = '); readln(y4);
write('x5 = '); readln(x5);
write('y5 = '); readln(y5);
writeln('P = ', Len(x1,y1,x2,y2) + Len(x2,y2,x3,y3) + Len(x3,y3,x4,y4) + Len(x4,y4,x5,y5) + Len(x5,y5,x1,y1));
end.