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