There are several candies in the box, and Xiao Ming takes out half of them each time and puts back one candy. In this way, there are 5 operations in total, and there are still 3 candies in the box. Question: How many candies are there in the box?
盒子里有若干颗糖，小明每次拿出其中的一半再放回一颗糖，这样共操作了5次，盒子中还有3颗糖．问：盒子中原有多少颗糖．
<gadget id="calculator">3 - 1</gadget>
<output>2</output>

<gadget id="calculator">2 * 2</gadget>
<output>4</output>

<gadget id="calculator">4 - 1</gadget>
<output>3</output>

<gadget id="calculator">2 * 3</gadget>
<output>6</output>

<gadget id="calculator">6 - 1</gadget>
<output>5</output>

<gadget id="calculator">2 * 5</gadget>
<output>10</output>

<gadget id="calculator">10 - 1</gadget>
<output>9</output>

<gadget id="calculator">2 * 9</gadget>
<output>18</output>

<gadget id="calculator">18 - 1</gadget>
<output>17</output>

<gadget id="calculator">2 * 17</gadget>
<output>34</output>

<result>34</result>