N,X,A,B = [int(input()) for _ in range(4)] print(min((X-1)//A, (2**(N-1)-X-1)//B) + 1)