#include typedef long long LL; LL n, x, a, b; int main() { scanf("%lld %lld %lld %lld", &n, &x, &a, &b); LL max = 1; for (int i = 0; i < n - 1; i++) max *= 2; LL at = 0; LL hp = x; while (hp > 0) { hp -= a; at++; } LL re = 0; hp = x; while (hp < max) { hp += b; re++; } if (at > re) printf("%lld\n", re); else printf("%lld\n", at); }