The smallest multiple of 5 is \(100 \Rightarrow (20 \times 5)\), and the largest multiple of 5 is \(995 \Rightarrow (199 \times 5)\). There are \(199 - 20 + 1 = 180\) multiples of 5
The smallest multiple of 8 is \(104 \Rightarrow (13 \times 8)\), and the largest multiple of 5 is \(995 \Rightarrow (124 \times 8)\). There are \(124 - 13 + 1 = 122\) multiples of 8
However, we overcount every \(\text{lcm}(5,8) = 40\) numbers.
The smallest number we overcount for is \(120 \Rightarrow (3 \times 40)\), and the largest number is \(960 \Rightarrow (24 \times 40)\). There are \(24 - 3 + 1 = 22\) numbers we overcount for.
Can you take it from here?