A, B, C, D = map(int, input().split()) ans = 0 for i in range(min(A, D)+1): x = i+i*C if x<=D: ans = i else: break print(ans)