For a smooth curve $C$ on a smooth, projective surface $S$ over $\mathbb{C}$, we have the genus formula:
$g(C) = 1 + \frac12(C^2 + C \cdot K_S)$
where $K_S$ is the canonical divisor. Is this formula still true for singular (e.g. reducible) curves on $S$ if one uses the arithmetic genus in the left hand side instead of the geometric genus?