'use strict'

function main(s) {  
  
  const input = s.split('\n').map(x => Number(x));
  const N = input[0];
  const K = input[1];
  const X = input[2];
  const Y = input[3];
  let result = 0;

  if(N > K) {
    result = (K * X) + ((N - K) * Y);
  } else {
    result = (N * X);
  }
  
  console.log(result);
}

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