There are several balls in the bag, and Donald Duck takes out half of them each time and puts back a ball. This is done 3 times in total, and there are still 3 balls in the bag. How many balls are there in the bag?
袋子里有若干个球，唐老鸭每次拿出其中的一半再放回一个球，这样一共做了3次，袋子中还有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>

<result>10</result>