a, b, c, d = map(int, input().split()) ans = 0 for i in range(a + 1): eat = i + c * i if eat <= d: ans = i print(ans)