There are 6 classes in the fourth and fifth grades of the school, with an average of 42 students in each class of the fourth grade and 45 students in each class of the fifth grade. How many students are there in the fourth and fifth grades?
学校四、五年级都有6个班，四年级平均每班42人，五年级平均每班45人．四、五年级共有多少人？
<gadget id="calculator">42 + 45</gadget>
<output>87</output>

<gadget id="calculator">87 * 6</gadget>
<output>522</output>

<result>522</result>