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