The correct way to account for the multiples of p and any of the later primes is to count the multiples of any of the later primes not exceeding m/p, because if k is a multiple of p as well as at least one of the later primes, then k/p is a multiple of one of the later primes that does not exceed m/p.