A certain kindergarten has a box of toys, take out half of it and 3 pieces to the children in the middle class, and then give the remaining half and 2 pieces to the children in the senior class, and there are 4 pieces left, how many toys are there in this box?
某幼儿园有一箱玩具，拿出它的一半又3件给中班的小朋友，然后再拿出其余的一半又2件给大班的小朋友，还剩下4件，问这箱玩具原来有多少件？
<gadget id="calculator">2 + 4</gadget>
<output>6</output>

<gadget id="calculator">6 * 2</gadget>
<output>12</output>

<gadget id="calculator">12 + 3</gadget>
<output>15</output>

<gadget id="calculator">15 * 2</gadget>
<output>30</output>

<result>30</result>