'use strict';
{
  const lines = require("fs").readFileSync("/dev/stdin", "utf8").split("\n");
  const ary = lines.map(str => Number(str));
  
 
  console.log(ary[2] * ary[1] + ary[3] * (ary[0] - ary[1]));
}