N = int(input()) X = int(input()) A = int(input()) B = int(input()) ov = 2**(N-1) a = -(-X//A) b = -(-(ov-X)//B) print(min(a,b))