uses math;
var
n,i:integer;
co,mo,cx,mx:int64;
begin
assign(input,'bs.in'); assign(output,'bs.out');
reset(input); rewrite(output);
while not(eof) do
begin
readln(co,cx,mo,mx);
if ((mo=0) and (mx=0)) or ((co=0) and (cx=0)) then writeln('0') else
if (co=0) or (mo=0) then writeln(min(cx,mx)) else
if (cx=0) or (mx=0) then writeln(min(co,mo)) else
if cx=co then writeln(cx+co) else
if cx>co then writeln(min(mx*(co+1)+co,cx+co)) else
if cx<co then writeln(min(mo*(cx+1)+cx,cx+co));
end;
end.