There is a batch of grain in the warehouse. On the first day, more than half of the total grain was shipped out, which was more than 18 tons. On the second day, the remaining half was shipped out, which was less than 5 tons. At this time, there were still 40 tons left in the warehouse. How many tons of grain were there in the warehouse? ?
仓库里有一批粮食，第一天运出全部粮食的一半多18吨，第二天运出余下的一半少5吨，这时仓库里还剩下40吨没运，仓库里原来有粮食多少吨？
<gadget id="calculator">40 - 5</gadget>
<output>35</output>

<gadget id="calculator">35 * 2</gadget>
<output>70</output>

<gadget id="calculator">70 + 18</gadget>
<output>88</output>

<gadget id="calculator">88 * 2</gadget>
<output>176</output>

<result>176</result>