#include #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; using lint=long long; int main(){ int n; lint x,a,b; cin>>n>>x>>a>>b; printf("%lld\n",min((x+a-1)/a,((1<<(n-1))-x+b-1)/b)); return 0; }