#include #include int main(void) { long n,x,a,b; scanf("%ld%ld%ld%ld",&n,&x,&a,&b); if((x+a-1)/a>((long)pow(2,n-1)-2-x+b)/b)printf("%ld",((long)pow(2,n-1)-1-x+b)/b); else printf("%ld",(x+a-1)/a); return 0; }