The 5th graders planted 30 x 2 = <<30*2=60>>60 trees.
Thrice the number of trees planted by the 5th graders is 60 x 3 = <<60*3=180>>180.
So, the 6th graders planted 180 - 30 = <<180-30=150>>150 trees.
Therefore, they planted a total of 30 + 60 + 150 = <<30+60+150=240>>240 trees.
#### 240