import Control.Applicative
import Control.Monad

judge :: Int -> Int -> Int -> Int
judge n a b = b * (ceiling $ (fromIntegral n) / (fromIntegral a))

main = do
  (n:a:b:c:d:_) <- (map (read :: String -> Int) . words) <$> getLine
  print $ min (judge n a b) (judge n c d)

