program bs;
var
ans,count,max,counto,countx,maxo,maxx:int64;
begin
assign (input,'bs.in');
reset (input);
assign (output,'bs.out');
rewrite (output);
while not(eof(input)) do begin
readln (counto,countx,maxo,maxx);ans:=0;
if counto<countx then count:=counto else if counto=countx then count:=counto-1 else count:=countx;
if maxo<maxx then ans:=count*maxo+(count+1)*maxx else ans:=count*maxx+(count+1)*maxo;
writeln (ans);
end;
close (input);
close (output);
end.