Out of 5 bags, he had 9+12+8+8+3 = <<9+12+8+8+3=40>>40 brown M&M's
He ate 5 bags so the average number of brown M&M's per bag was 40/5 = <<40/5=8>>8 brown M&M's
#### 8