function main(input) {
  input = input.trim();
  const [a,b,c,d] = input.split('\n').map(Number);
  let k = b*c;
  let k2 = 0;
  if(a>b){
    k2 = (a-b)*d;
  }else{
    k2 = 0;
  }
  console.log(k+k2);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));