Let $n$ be an integer coprime to $d$. Show that the map $$(a,b)\mapsto(na,nb)$$ is a bijection from $S_{\mathrm{prim}}(d)$ to $S_{\mathrm{prim}}(d)$.