From 1 to 1000, the numbers ÷ by 2 = 500 the number ÷ by 5 = 200 and the numbers ÷ by 10 = 100(5 × 2 = 10)
So number ÷ by 2 or 5 = 500 + 200 – 100 = 600
Total numbers from 1 to 1000 = 1000
So the number of numbers which are ÷ neither by 2 nor by 5 = 1000 – 600 = 400