There are several balls in a bag, take out half of them each time and put back a ball, after doing this twice, there are still 3 balls in the bag. How many balls were there originally in the bag?
一个袋子里有若干个球，每次拿出其中的一半再放回去一个球，这样操作了2次后，袋子里还有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>

<result>6</result>