The teacher goes to the stationery market to buy New Year’s Day gifts from his classmates. If he buys 30 homework books, the difference is 4 yuan, and if he buys 40 ballpoint pens, the remaining 2 yuan. It is known that the unit prices of these two kinds of stationery differ by 30 cents and 5 cents, so how much yuan did the teacher bring in total?
老师去文具市场买同学们的元旦礼物，他带的钱如果买30个作业本则差4元，如果买40支圆珠笔则剩余2元．已知这两种文具的单价相差3角5分，那么老师一共带了多少元钱．
<gadget id="calculator">0.35 * 30</gadget>
<output>10.5</output>

<gadget id="calculator">10.5 - 4 - 2</gadget>
<output>4.5</output>

<gadget id="calculator">40 - 30</gadget>
<output>10</output>

<gadget id="calculator">4.5 / 10</gadget>
<output>0.45</output>

<gadget id="calculator">0.45 * 40</gadget>
<output>18</output>

<gadget id="calculator">18 + 2</gadget>
<output>20</output>

<result>20</result>