N=int(input()) X=int(input()) A=int(input()) B=int(input()) N-=1 N=2**N N-=X A=X//A #A+=1 B=N//B if A>B: A=B print(B)