#include typedef long long ll; using namespace std; int INF = 1LL << 30; int MOD = 1e9+7; main(){ ll N,X,A,B; cin >> N >> X >> A >> B; ll maxi = (1 << (N-1)); ll a = (X + A - 1) / A; ll b = (maxi - X + B - 1) / B; cout << min(a,b) << endl; }