Xiaoming bought a book with 5 yuan, bought a pen with half of the remaining money, bought an eraser and used half of the remaining money for more than 1 yuan, and finally left 3 yuan. How much money did Xiaoming have?
小名用5元买了一本书，又用剩下的钱的一半买了钢笔，买橡皮用去剩下的钱的一半多1元，最后还剩3元，小名原来有多少钱？
<gadget id="calculator">3 + 1</gadget>
<output>4</output>

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

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

<gadget id="calculator">16 + 5</gadget>
<output>21</output>

<result>21</result>