Genus Formula for the Modular Curve $X_0(N)$