import Control.Applicative
import Control.Monad
import Data.List

main :: IO ()
main = do
    [n, k, x, y] <- replicateM 4 readLn :: IO [Int]
    let dx = min k n
    let dy = n - dx
    print $ x * dx + y * dy