<human>:  A school does a yearly tree planting activity. This year, the 4th graders planted a total of 30 trees while 5th graders planted twice as many. The 6th graders planted 30 fewer than thrice the number of trees planted by the 5th graders. How many trees did they plant altogether?
<bot>: How many trees did the 5th graders plant? ** The 5th graders planted 30 x 2 = <<30*2=60>>60 trees.
How many trees did the 6th graders plant? ** Thrice the number of trees planted by the 5th graders is 60 x 3 = <<60*3=180>>180.
How many trees did the 6th graders plant? ** So, the 6th graders planted 180 - 30 = <<180-30=150>>150 trees.
How many trees did the 4th, 5th, and 6th graders plant altogether? ** Therefore, they planted a total of 30 + 60 + 150 = <<30+60+150=240>>240 trees.
#### 240