A, B, C, D = map(int, input().split()) pack = (1 + C) ans = 0 for i in range(D//pack): if A > 0 and B-C >= 0: A -= 1 B -= C ans += 1 print(ans)