main :: IO () main = do abcd <- map read . words <$> getLine putStrLn $ show $ solve abcd solve :: [Int] -> Int solve [a, b, c, d] | a < maximum = a | d < maximum = d `div` b | otherwise = maximum where maximum = b `div` c