Let’s p is a prime number. Let’s a_1,...,a_k are all numbers from set divisible by p. WLOG |a_1|_p=<|a_2|_p=<...=<|a_k|_p.
Take numbers a_k,...,a_{k-99}. Then |a_k|_p+...+|a_{k-99}|_p=<|a_1|_p+...+|a_{k-100}|_p.
So, k-100>=100, that is k>=200.
So, if S contains prime p, then there are at least 199 composite numbers. It means that there are at most 1820 prime numbers.
Example: let’s S contains p_1,...,p_1820 and 199 numbers of form p_1...p_1820.
This example works, because product of any 100 numbers can’t be divisible by p_i^{101} and product of any 1919 numbers is divisible by p_i^{100}. So statement of problem holds.