F = input() E = F.split(" ") A = int(E[0]) B = int(E[1]) C = int(E[2]) D = int(E[3]) for n in range(A+1): if n*C + n > D: print(n-1) break