There are several bags of rice in the grain depot. Half of the stock was shipped out for the first time, more than 20 packs, the remaining half was shipped out for the second time, more than 40 packs, and 140 packs were shipped out for the third time. There were still 50 packs left in the grain depot. How many packets of rice are there in Liyuan?
粮库内存有大米若干包，第一次运出库存的一半多20包，第二次运出剩下一半多40包，第三次运出140包，粮库里还剩50包，粮库里原有大米多少包？
<gadget id="calculator">140 + 50 + 40</gadget>
<output>230</output>

<gadget id="calculator">230 * 2</gadget>
<output>460</output>

<gadget id="calculator">460 + 20</gadget>
<output>480</output>

<gadget id="calculator">480 * 2</gadget>
<output>960</output>

<result>960</result>