import           Control.Monad
import           Data.List

main :: IO ()
main = do
  i <- replicateM 4 readLn
  print $ solve i

solve :: [Int] -> Int

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