var
x,y,z,min,a,b:integer;
Begin
read(x,y,z);
a=sqr(x)+sqr(y)-4;
b:=sqr(y)*sqr(x)-4;
if a<b then min:=a else min:=b;
writeln(min);
End.
var
x,y,z,min,a,b:integer;
Begin
read(x,y,z);
a=sqr(x)+sqr(y)-4;
b:=sqr(y)*sqr(x)-4;
if a<b then min:=a else min:=b;
writeln(min);
End.