Program Pool;
{Pasichov}
Var     S            : array [1..4,1..2] of real;
     x,y,x1,y1,x2,y2 : real;
     Min,R           : real;
     i               :integer;

 Procedure Inp;
   Begin
     Read(x,y,x1,y1,x2,y2);
     S[1,1]:=x2;
     S[1,2]:=-y2;
     S[2,1]:=2*x-x2;
     S[2,2]:=y2;
     S[3,1]:=x2;
     S[3,2]:=2*y-y2;
     S[4,1]:=-x2;
     S[4,2]:=y2;
  End;

 Function Rast(a1,o1,a2,o2:real):real;
   Begin
    Rast:=sqrt(sqr(o1-o2)+sqr(a1-a2));
   End;

 BEGIN
    Inp;
    Min:=1e38;
    for i:=1 to 4 do
      begin
        R:=Rast(x1,y1,S[i,1],S[i,2]);
        if R<Min then Min:=R;
      end;
    Write(Min);
END.
