import Control.Monad

main :: IO ()
main = do
  [n,k,x,y] <- replicateM 4 readLn
  print $ charge n k x y

charge :: Int -> Int -> Int -> Int -> Int
charge n k x y = sum $ take n (replicate k x ++ repeat y)