First find the total distance the ball flies: 20 feet/second * 8 seconds = <<20*8=160>>160 feet
Then divide that distance by the dog's speed to find how long it takes the dog to catch up to the ball: 160 feet / 5 feet/second = <<160/5=32>>32 seconds
#### 32