Ben has 8 apples more than Phillip does. Tom has three eighths as many apples at Ben has. If Phillip has 40 apples, how many apples does Tom have?
Ben has 40+8 = 
<gadget id="calculator">40+8</gadget>
<output>48</output>
48 apples.
There are 48/8 = 
<gadget id="calculator">48/8</gadget>
<output>6</output>
6 apples in every eighth.
Tom has 6*3 = 
<gadget id="calculator">6*3</gadget>
<output>18</output>
18 apples.

<result>18</result>