Let postive integer $n$ is not a power of a prime. Prove that $$\sum_{1\le k\le n-1,\gcd{(k,n)}=1}k=\dfrac{1}{2}n\varphi{(n)}\tag{1}$$ where $\varphi{(n)}$ is the Euler totient function
I kown $$\sum_{1\le k\le n-1,\gcd{(k,n)}=1}=\varphi{(n)}$$But I can't prove question $(1)$