Kristy baked cookies because her friends are coming over to her house. She ate 2 of them and gave her brother 1 cookie. Her first friend arrived and took 3 cookies. The second and third friends to arrive took 5 cookies each. If there are 6 cookies left, how many cookies did Kristy bake?
There were 6 + 5 = 
<gadget id="calculator">6+5</gadget>
<output>11</output>
11 cookies left before the third friend took 5.
There were 11 + 5 = 
<gadget id="calculator">11+5</gadget>
<output>16</output>
16 cookies left before the second friend took 5.
There were 16 + 3 = 
<gadget id="calculator">16+3</gadget>
<output>19</output>
19 cookies left before the first friend took 3.
There were 19 + 1 = 
<gadget id="calculator">19+1</gadget>
<output>20</output>
20 cookies left before Kristy gave 1 cookie to her brother.
There were 20 + 2 = 
<gadget id="calculator">20+2</gadget>
<output>22</output>
22 cookies that Kristy baked.

<result>22</result>