"use strict";

function main(input){
  const nkxy = input.trim().split('\n').map(_=>parseInt(_, 10));
  const n = nkxy[0];
  const k = nkxy[1];
  const x = nkxy[2];
  const y = nkxy[3];
  
  if(n <= k) console.log(x*n); 
  else console.log(x*k + y*(n-k));
}

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