import java.util.*; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n=scan.nextInt(); long x=scan.nextLong(); long a=scan.nextLong(); long b=scan.nextLong(); long mi=(x+a-1)/a; mi=Math.min(mi,((1<<(n-1))-x+b-1)/b); System.out.println(mi); } }