N = int(input()) X = int(input()) A = int(input()) B = int(input()) max_health = 2**(N -1) - 1 attack = 0 heal = 0 HP = X while HP > 0: HP -= A attack += 1 HP = X while HP <= max_health: HP += B heal += 1 if attack >= heal: print(heal) else: print(attack)