import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int X = scan.nextInt(); int A = scan.nextInt(); int B = scan.nextInt(); scan.close(); long max = (long)Math.pow(2, N - 1); int t1 = (int)Math.ceil((double)X / A); int t2 = (int)Math.ceil(((double)max - X) / B); int ans = Math.min(t1, t2); System.out.println(ans); } }