defmodule Main do def main do [a, b, c, d] = IO.gets("") |> String.trim |> String.split |> Enum.map(&String.to_integer/1) e = div(b, c) f = div(d, (c + 1)) n = Enum.min([a, e, f]) IO.puts n end end