During the Spring Festival, Xiaoming got a batch of New Year’s gifts—books, among which popular science books are three times as many as literature books, and literature books are 40 fewer than three times the number of popular science books. So, how many books are there in total?
小明春节得到了一批新年礼物--图书，其中科普类图书是文学类图书的3倍，而文学类图书比科普类图书的3倍少40本．那么，这批图书共有多少本？
<gadget id="calculator">3 * 3</gadget>
<output>9</output>

<gadget id="calculator">9 - 1</gadget>
<output>8</output>

<gadget id="calculator">40 / 8</gadget>
<output>5</output>

<gadget id="calculator">5 * 3</gadget>
<output>15</output>

<gadget id="calculator">5 + 15</gadget>
<output>20</output>

<result>20</result>