Ben has 40+8 = <<40+8=48>>48 apples.
There are 48/8 = <<48/8=6>>6 apples in every eighth.
Tom has 6*3 = <<6*3=18>>18 apples.
#### 18