import Data.Int (Int64)

totalAmount :: Integral a => a -> a -> a -> a -> a
totalAmount n k x y = a1 + a2
    where
        a1 = x * min k n
        a2 = (*) y $ max 0 $ n - k

main :: IO ()
main = do
    n <- readLn :: IO Int64
    k <- readLn :: IO Int64
    x <- readLn :: IO Int64
    y <- readLn :: IO Int64
    print $ totalAmount n k x y
