def main(): N, X, A, B = (int(input()) for _ in [0] * 4) attack = (X + A - 1) // A bin_ = '1' + '0' * (N - 1) overflow = int(bin_, 2) recovery = (overflow - X + B - 1) // B print(min(attack, recovery)) main()