A,B,C,D =map(int,input().split()) if B/C >=A and A+B=1 and int(B/C)+B=1 and int(B/C)+B>D: ans=D/(C+1) else: ans=0 print(int(ans))