I am self studying a topic in number theory and I need help in solving a summation in it.

Summation is S = $sum_{q, l} 1 $ subject to conditions (11) and (13) which could be written as $sum_{q,l , (11), (13) } 1 $, where (11) is $q leq log^{3n} n $ and (13) is $-1/2< x-l/q leq 1/2.$ Here $n$ is an integer sufficiently large, $l$ belongs to integers and $q$ belongs to positive integers, $x in mathbb R,$ and $gcd $(l, q) =1.$

It is to be proved that $sum_{q,l , (11), (13) } 1$ = $sum_{q, (11) } q < log^{6n} n $ .

I am really confused on how to do it.

$S = sum limits_{q,l, (q,l)=1} 1 leq sum limits_{q,l} 1$ and we have that $-0.5 leq x-frac{l}{q} leq 0.5 $ so $ x-0.5leq frac{l}{q} leq x+0.5$ so $ q(x-0.5) leq l leq q(x+0.5)$ and we have that $S = sum limits_{q} sumlimits_{l = q(x-0.5)}^{q(x+0.5)}1$ and we have $q(x+0.5)-q(x-0.5)$ many times ‘1’ so we have that $sumlimits_{l = q(x-0.5)}^{q(x+0.5)}1 = q $ and then we have that $sum limits_{qleq ln^{3n} n} q = sum limits_{q=1}^{ln^{3n}n} q = frac{ln^{3n}n(ln^{3n}n+1)}{2} leq ln^{6n}n$ for all $n geq 3$.

Note : the above is valid becuase we are looking for upper bound and the fact that without the condition that $(q,l)=1$ we make the sum $S$ bigger.