I need a reference (or a short proof) for the following statement:


Suppose a closed manifold $N$ is the result of a surgery (along an embedded sphere) on a closed manifold $M$. Then the difference $\sum dim H\_i(N) - \sum dim H\_i(M)$ (the homology is taken with coefficients in a field) is at most 2.



Surgery and homology: a reference request
To say that a smooth, closed manifold $N$ is obtained by surgery along a (framed) sphere in $M$ is to say that there is a cobordism $P$ from $M$ to $N$ and a Morse function $f\colon P\to [0,1]$, with $f^{-1}(0)=M$, $f^{-1}(1)=N$, and exactly one critical point $c$. By Morse theory, $H\_\*(P,M)$ is then 1-dimensional, generated by the descending disc of $c$. Likewise, $H\_\*(P,N)$ is 1-dimensional, generated by the ascending disc of $c$. 


By the homology exact sequence of the pair $(P,M)$, $\dim H\_\*(M)$ differs from $\dim H\_\*(P)$ by $1$. By the homology exact sequence of the pair $(P,N)$, $\dim H\_\*(N)$ also differs from $\dim H\_\*(P)$ by $1$. Hence $|\dim H\_\*(M) - \dim H\_\*(N)|$ is $0$ or $2$.


