a,b,c,d = [int(i) for i in input().split()] e = 0 v = 0 m = 0 while e <= d and m <= b and v <= a: if e + (c+1) <= d: e += c+1 v += 1 m += c else: break print(v)