program prefab;
Uses math;
var A,B,X,Y : longint;
Procedure scambia (var p,q: longint);
var r:longint;
begin
r:=p;
p:=q;
q:=r;
end;
function assess(groundA, groundB, roofX, roofY: longint): longint;
var res:longint;
begin
if (groundA<groundB) then scambia(groundA, groundB);
if (roofX<roofY) then scambia(roofX, roofY);
if(groundA >= roofX) and (groundB >= roofY) then res:=0
else
if(groundA < roofX ) and (groundB < roofY) then res:=roofX*roofY - groundA*groundB
else
if(roofY>=groundB) then res:= ((roofY -groundB) div 2 + (roofY - groundB) mod 2) * roofX
else
if(roofX>=groundA) then res:=((roofX - groundA) div 2 + (roofX - groundA) mod 2) * roofY;
assess:=res;
end;
begin
(*assign(input, 'input.txt'); reset(input);
assign(output, 'output.txt'); rewrite(output);*)
readln(A, B, X, Y);
writeln(assess(A, B, X, Y));
end.
cHJvZ3JhbSBwcmVmYWI7ClVzZXMgbWF0aDsKdmFyIEEsQixYLFkgOiBsb25naW50OwoKUHJvY2VkdXJlIHNjYW1iaWEgKHZhciBwLHE6IGxvbmdpbnQpOwp2YXIgcjpsb25naW50OwpiZWdpbgogICByOj1wOwogICBwOj1xOwogICBxOj1yOwplbmQ7CgpmdW5jdGlvbiBhc3Nlc3MoZ3JvdW5kQSwgZ3JvdW5kQiwgcm9vZlgsIHJvb2ZZOiBsb25naW50KTogbG9uZ2ludDsKdmFyIHJlczpsb25naW50OwpiZWdpbgogICAgaWYgKGdyb3VuZEE8Z3JvdW5kQikgdGhlbiBzY2FtYmlhKGdyb3VuZEEsIGdyb3VuZEIpOwogICAgaWYgKHJvb2ZYPHJvb2ZZKSB0aGVuIHNjYW1iaWEocm9vZlgsIHJvb2ZZKTsKICAgIGlmKGdyb3VuZEEgPj0gcm9vZlgpIGFuZCAoZ3JvdW5kQiA+PSByb29mWSkgdGhlbiByZXM6PTAKICAgICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAgICAgaWYoZ3JvdW5kQSA8IHJvb2ZYICkgYW5kIChncm91bmRCIDwgcm9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