main :: IO ()
main = do
  n <- readLn :: IO Int
  k <- readLn :: IO Int
  x <- readLn :: IO Int
  y <- readLn :: IO Int
  print $ base n x + ano (n-k) y
        where base n x = n * x
              ano rest y = max 0 rest*y
