import java.io.*; import java.util.*; public class Main_yukicoder598 { private static Scanner sc; private static Printer pr; private static void solve() { int n = sc.nextInt(); long x = sc.nextLong(); long a = sc.nextLong(); long b = sc.nextLong(); long min = (x + a - 1) / a; long tmp = 0x1L << (n - 1); min = Math.min(min, (tmp - x + b - 1) / b); pr.println(min); } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }