No. of three digit multiples of 5 =
(995 - 100)/5 + 1 = 180
Number of three digit multiples of 8 =
(992 - 104) / 8 + 1 = 112
Number of three digit multiples of 5 and 8 = those divisible by 40
( 960 - 120) / 40 + 1 = 22
Number of three digit multiples of 5 and 8 = 180 + 112 - 22 = 271
Number of three digit multiples of neither 5 or 8 = 900 - 271 = 629