program Project1;
procedure init;
begin
assign(input,'bs.in');reset(input);
assign(output,'bs.out');rewrite(output);
end;
function min(a,b:int64):int64;
begin
if a<b then exit(a) else exit(b);
end;
procedure main;
var co,cx,mo,mx,temp:int64;
begin
while not eof do
begin
readln(co,cx,mo,mx);
if (mo=0)and(mx=0) then begin writeln(0);continue;end;
if (mo=0) then begin writeln(min(mx,cx));continue;end;
if (mx=0) then begin writeln(min(mo,co));continue;end;
if (mo=1)and(mx=1) then begin writeln(min(co+cx,min(co,cx)*2+1));continue;end;
if cx<co then
begin
temp:=cx+1;
temp:=temp*mo;
temp:=temp+cx;
writeln(min(temp,co+cx));
end
else
begin
temp:=co+1;
temp:=temp*mx;
temp:=temp+co;
writeln(min(temp,co+cx));
end;
end;
close(output);
end;
begin
init;
main;
end.