The 9 pupils who gave up all their chox gave a big hint how many each of them were suppose to get!
No. of pupils left --> 36 - 9 = 27
No. of extra chox that came from the 9 pupils who gave them up
--> 27 x 3 = 81
Number of chox each pupil is supposed to be given --> 81/9 = 9
Number of chox in the bag at first --> 9 x 36 = 324