A,B,C,D = map(int,input().split()) # 野菜の数の最大値をmaxとおく max = 0 for i in range(A+1): if i+i*C <= D: max = i else: break print(max)