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