Xiao Ming buys a pencil case and spends half of the money he brings, and buys a notebook with 4 yuan, leaving 16 yuan. How much money did Xiao Ming bring?
小明买一个铅笔盒用去所带钱的一半，买一本笔记本有用去4元，这时还剩16元．小明原来带了多少钱？
<gadget id="calculator">4 + 16</gadget>
<output>20</output>

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

<result>40</result>