import math n = int(input()) x = int(input()) a = int(input()) b = int(input()) print(math.ceil(min(x / a, ((pow(2, n-1) - x) / b))))