function main(input) {
  input=input.trim();
  const n = parseInt(input.split("\n")[0], 10);
  const k = parseInt(input.split("\n")[1], 10);
  const x = parseInt(input.split("\n")[2], 10);
  const y = parseInt(input.split("\n")[3], 10);

  if(n>k){
    console.log(k*x+(n-k)*y);
  }else{
    console.log(k*x);
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));