#include using namespace std; int main(void) { int n, x, a, b; cin >> n >> x >> a >> b; cout << min((x + a - 1) / a, ((1 << (n - 1)) - x + b - 1) / b) << endl; return 0; }