function main(input) {
  const args = input.split('\n');
  const N = parseInt(args[0], 10);
  const K = parseInt(args[1], 10);
  const X = parseInt(args[2], 10);
  const Y = parseInt(args[3], 10);
  let ans;
  
  if (N < K) {
    ans = N * X;
  } else {
    ans = ((N - K) * Y)  + K * X;
  }
  
  console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));