Define $\omega(n)$ as number of distinct prime factors $n$ has, that is if $n=p_1^{a_1}... p_k^{a_k}$, then $\omega(n)=k$.
It is commonly understood that normal order of $\omega(n)$ is $\log\log(n)$, which one can derive from Turán result as follows.
$$\sum_{n\leq x}(\omega(n)-\log\log(x))^2=O(x\log\log(x))$$
However, the problem requires me to refine above result, which states that there is constant $c>0$ that
$$\sum_{n\leq x}(\omega(n)-\log\log(x))^2=x\log\log(x)+cx+O(\frac{x\log\log(x)}{\log(x)})$$
Is there any possible method to approach this result?
(This is exercise 4.9 from Murty's sieve book which I was trying to understand.)