Arnel shared 5 x 8 = <<5*8=40>>40 pencils with his friends.
So, he had 10 + 40 = <<10+40=50>>50 pencils in all.
Therefore, each box had 50/10 = <<50/10=5>>5 pencils inside.
#### 5