Let $F: \mathbb{R}^{n} \to \mathbb{R}$ be a smooth function. Suppose $B$ be a closed and bounded box. I would like to obtain for fixed $q \in \mathbb{N}$ $$ \# \{ \mathbf{a} \in \mathbb{Z}^n : F(\frac{\mathbf{a}}{q} ) = 0 , \ \frac{\mathbf{a}}{q} \in B \} < C q^{n-1}, $$ where $C$ is independent of $q$.

I think this is not possible if $F$ has a region where it is identically zero inside $B$. So my question is what assumption on $F$ is necessary on $B$ so that this bound can be achieved. Any comments would be appreciated. Thank you.