n = input() hp = input() attack = input() heal = input() def kill_by_attack(hp,attack): time = hp / attack if(hp%attack != 0): time += 1 return time def kill_by_heal(n,hp,heal): over_flow_hp = 2 ** n - 2 ** (n - 1) time = (over_flow_hp-hp)/heal if((over_flow_hp-hp)%heal != 0): time += 1 return time print min(kill_by_attack(hp,attack),kill_by_heal(n,hp,heal))