n,x,a,b=io.read("*n","*n","*n","*n") p1 = math.ceil(x/a) p2 = math.ceil((2^(n-1)-x)/b) print(math.min(p1, p2))