yasai, niku, c, d = map(int, input().split()) ans = 0 while True: d -= c + 1 yasai -= 1 niku -= c if d < 0 or yasai < 0 or niku < 0: break ans += 1 print(ans)