main = do
    n <- getInt
    k <- getInt
    x <- getInt
    y <- getInt
    print $ solve n k x y

getInt :: IO Int
getInt = read <$> getLine

solve n k x y
    | n <= k = n * x
    | otherwise = k * x + (n - k) * y