import math N = int(input()) X = int(input()) A = int(input()) B = int(input()) print(min(math.ceil((2 ** (N - 1) - X) / B), math.ceil(X / A)))