There are 9 + 12 = <<9+12=21>>21 students in a class.
Hence, 21/3 = <<21/3=7>>7 groups are formed.
#### 7