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