#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; using ll = long long; using ld = long double; int main(){ cin.tie(0); ios::sync_with_stdio(0); ll N,X,A,B; cin >> N >> X >> A >> B; ll ansA = (X + A - 1) / A; ll ansB = ((1LL << (N - 1)) - X + B - 1) / B; cout << min(ansA, ansB) << endl; }