'use strict';
{
  const lines = require("fs").readFileSync("/dev/stdin", "utf8").split("\n");
  const ary = lines.map(str => Number(str));

  if ((ary[0] - ary[1]) > 0) {
    console.log(ary[2] * ary[1] + ary[3] * (ary[0] - ary[1]));
  } else {
    console.log(ary[2] * ary[0]);
  }
}
