There are some pears in the basket, Xiaoxiao takes one more than half of the total number, and Xiaoming takes one more than half of the remaining pears after Xiaoxiao takes away. At this time, there are still 3 pears in the basket, how many pears are there in total?
篮子里有一些梨，笑笑取走总数的一半多一个，小明取走了笑笑取走后剩下的一半多一个，这时篮子里还剩3个梨，一共有多少个梨？
<gadget id="calculator">3 + 1</gadget>
<output>4</output>

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

<gadget id="calculator">8 + 1</gadget>
<output>9</output>

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

<result>18</result>