Var x,y,k,err:integer;s:string;d,e:real;
begin
err:=0;
read (x,y);
d:=max (x+y,y-x) + 3;
e:=min (sqr(x)+sqr(y),sqr(y)+x*y) - 4;
str (e,s);
k:=length(s);
val (s,e,err);
if (dbegin
d:=d+(e div (10*(k-1)));
end else
begin
d:=power (d,1/(e div (10*(k-2))));
end;
writeln (d);
end.