While reading a paper about the modular group $\Gamma = PSL_2(\mathbb{Z})$, I came upon the following sentence ($\Gamma(N)$ is the kernel of the canonical map $PSL_2(\mathbb{Z}) \rightarrow PSL_2(\mathbb{Z}/N\mathbb{Z})$, which is a surjection):
"It is well-known that the index of $\Gamma(N)$ in $\Gamma$ is $\frac{N^3}{2} \prod_{p|N}(1-\frac{1}{p^2})$ for $N \geq 3$."
Now, I was wondering, how do you calculate this ? I understand that basically, this means you have to calculate the number of elements in $GL_2(\mathbb{Z}/N\mathbb{Z})$ and then divide by 2 times the number of invertible elements of $\mathbb{Z}/N\mathbb{Z}$, but there I'm stuck. I know that for $N$ prime, this holds.