Program abc;
var R, a, b, c, d: integer;
begin
readln(a, b, c, d);
R:=(a+b-c)*d;
writeln(R);
Readln;
end.
Program abc;
var R, a, b, c, d: integer;
begin
readln(a, b, c, d);
R:=(a+b-c)*d;
writeln(R);
Readln;
end.