n = int(input())
x = int(input())
a = int(input())
b = int(input())

a = (x + a - 1)//a
b = ((1<<(n-1)) - x + b - 1)//b

print(min(a,b))