Greg and Sarah have 18 apples that they are going to split evenly. Susan has twice as many apples as Greg will end up with. Mark has 5 fewer apples than Susan. Their mom needs 40 apples to make an apple pie. How many will she have left over?
Greg and Sarah will split their apples, so 18 apples / 2 = 
<gadget id="calculator">18/2</gadget>
<output>9</output>
9 apples per child.
Susan has 2 * 9 apples = 
<gadget id="calculator">2*9</gadget>
<output>18</output>
18 apples.
Mark has 18 apples - 5 apples = 
<gadget id="calculator">18-5</gadget>
<output>13</output>
13 apples.
Combined the children have 9 apples + 9 apples + 18 apples + 13 apples = 
<gadget id="calculator">9+9+18+13</gadget>
<output>49</output>
49 apples.
Mom will have 49 apples - 40 apples = 
<gadget id="calculator">49-40</gadget>
<output>9</output>
9 apples left over.

<result>9</result>