Kindergarten distributes a batch of apples to large, medium and small classes. The large class gets 20 more than half of the total number, the middle class gets 20 less than the remaining half, and finally all the remaining 140 are given to the small class. So how many apples are there in total?
幼儿园将一批苹果分给大、中、小三个班，大班分得总个数的一半多20个，中班分得余下的一半少20个，最后把剩下的140个全部给了小班，那么这批苹果一共有多少个．
<gadget id="calculator">140 - 20</gadget>
<output>120</output>

<gadget id="calculator">120 * 2</gadget>
<output>240</output>

<gadget id="calculator">240 + 20</gadget>
<output>260</output>

<gadget id="calculator">260 * 2</gadget>
<output>520</output>

<result>520</result>