Xiao Ming bought some pencils when he started school. He used half of the total number of pencils in the first month, and 2 more. How many pencils?
小明开学时买了一些铅笔，他第一个月用了总数的一半多2支，第二个月用了余下的一半多1支，这时小明还剩下3支铅笔，则小明一共买了多少支铅笔？
<gadget id="calculator">1 + 3</gadget>
<output>4</output>

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

<gadget id="calculator">8 + 2</gadget>
<output>10</output>

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

<result>20</result>