The fourth, fifth and sixth grades of the school participated in the tree planting activity. It was planned to plant 100 trees, the sixth grade planted 47 trees, the fifth grade planted 12 trees less than the sixth grade, and the rest were planted by the fourth grade. How many trees were planted in the fourth grade?
学校四、五、六年级参加植树活动，计划植树100棵，六年级植了47棵，五年级比六年级少植12棵，剩下的由四年级种，四年级种了多少棵？
<gadget id="calculator">47 - 12</gadget>
<output>35</output>

<gadget id="calculator">100 - 47 - 35</gadget>
<output>18</output>

<result>18</result>