import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { public static long MOD = 1000000007; public static void main(String[] args) { Scanner sc = new Scanner(System.in); final long N = sc.nextInt(); final long X = sc.nextLong(); final long A = sc.nextLong(); final long B = sc.nextLong(); final long A_time = (X + A - 1) / A; final long B_time = (((1l << (N - 1)) - X) + B - 1) / B; //System.out.println((1 << (N - 1)) + " " + X); //System.out.println(A_time + " " + B_time); System.out.println(Math.min(A_time, B_time)); } }