Let $p_1,p_2,...p_k$ be a finite set of prime numbers. Prove that the number of positive integers $n \leq x$ that can be written in the form $n=p_1^{r_1}p_2^{r_2}...p_k^{r_k}$ is at most $$ \prod_{i=1}^{k} (\frac{\log x}{\log p_i}+1)$$ Prove that if $x$ is sufficiently large, then there are positive integers $n \leq x$ that cannot be represented in this way.
I encountered this problem while going through the book "Elementary Methods in Number Theory" by Nathanson. Here, no additonal theory except the basic elementary facts about primes are given before this problem. Using these tools, can anyone please try and solve or give hints? I tried but I couldn't approach the problem.