import java.util.Scanner; public class No598 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextInt(); long X = sc.nextInt(); long A = sc.nextInt(); long B = sc.nextInt(); long MAX =(long)Math.pow(2, N-1); System.out.println((long)Math.min(Math.ceil((double)X/A),Math.ceil((double)(MAX-X)/B))); } }