So you know the school donated 9 pies, so you want to know how many pieces are in 9 pies. (remember 8 pieces per 1 pie)
9 x 8 = 72
Next you subtract the amount you got to total amount.(224)
So 224 - 72 is 152.
152 is how many pieces of pie were sold by students.
To configure this number back to amount of pie, you basically need to divide by 8(number of pieces in 1 pie).
152 divided by 8 is 19. So 19 pies were sold by students.
Hope this helped!