Hector purchased a container of gumballs.  He gave 4 to Todd, then he gave twice as many as he had given Todd to Alisha, and then he gave 5 less than four times as many to Bobby as he had given to Alisha.  If Hector had 6 gumballs remaining, what is the total number of gumballs that Hector purchased?
Hector gave to Alisha twice as many as he had given Todd, for a total of 4*2=
<gadget id="calculator">4*2</gadget>
<output>8</output>
8 gumballs,
Hector gave 5 less than four times as many to Bobby as he had given to Alisha, or a total of (8*4)-5=
<gadget id="calculator">8*4-5</gadget>
<output>27</output>
27 gumballs.
If Hector had 6 gumballs remaining, he originally purchased 4+8+27+6=
<gadget id="calculator">4+8+27+6</gadget>
<output>45</output>
45 gumballs.

<result>45</result>