How to verify this statement in optical theorem? There is a statement in optical theorem (From Peskin & Schroeder):

It is easily checked (in QED, for example) that each diagram contributing to an S-matrix element $\mathcal{M}$ is purely real unless some denominators vanish, so that $i\epsilon$ prescription for the treating the poles becomes relevant. 

This statement comes from Peskin & Schroeder, pp.232. I guess we can verify this statement simply by looking into a general Feynman diagram and count how many propagators and how many vertices such that we know how many $i$ will be there. But I wonder whether there is a more general proof for this statement. Here is a hint:
S-matrix is defined as 
$$\langle\vec{p}_1\vec{p}_2...|S|\vec{k}_1\vec{k}_2...\rangle\equiv {}_\mbox{out}\langle\vec{p}_1\vec{p}_2...|\vec{k}_1\vec{k}_2...\rangle_\mbox{in}=\lim_{T\rightarrow\infty}\langle\vec{p}_1\vec{p}_2...|e^{-iH(2T)}|\vec{k}_1\vec{k}_2...\rangle.$$ 
In path-integral, S-matrix will be
$$S\sim\lim_{T\rightarrow\infty(1-i\epsilon)}\int\mathcal{D}\phi e^{i\int d^4x\mathcal{L}}=\mbox{series of expansion}.\tag{1}$$
And according to $S=1+iT\sim 1+i\mathcal{M}$. The hope is to prove that $\mathcal{M}$ is purely real unless some denominators vanish in the series of expansion.
Would somebody give a complete proof? Thank you very much.
 A: I believe they are just describing in words the following equation
$$\frac{1}{p^2- m^2 \pm i\epsilon} = P\frac{1}{p^2- m^2} \,\mp\,i\pi \delta(p^2- m^2)  $$
where $P$ denotes the principal part. 
By the counting that you describe you can show that the factors of $i$ coming from propagators and vertices always balance out (you also need to remember that every loop will contribute a factor of $i$ from the Wick rotation). Then the equation above shows that the imaginary part of a Feynman diagram can only come from the $i\epsilon$ of some propagator, which is only relevant when an intermediate particle goes on-shell (i.e., $p^2=m^2$). This is the reason why they discuss this in the context of the optical theorem.
Edit: Just in case, the counting of $i$'s is as follows. For any graph with $V$ vertices, $P$ propagators, and $L$ loops we have
$$i^V i^Pi^L \sim i^{V-P+L}$$
where the $\sim$ just means that I'm being cavalier about signs. Now we can use Euler's formula $V-P+F  =\chi$, where $F=L+1$ is the number of faces of the graph, and $\chi$ is the Euler characteristic of the Riemann surface in which we can embed the graph. Thus we find
$$i^{V-P+L} \sim i\, i^\chi $$
but the Euler characteristic of any orientable Riemann surface is always even ($\chi = 2-2g$, where $g$ is the genus), so in the end we have a single factor of $i$, which cancels against the one in the definition of the amplitude
$$i\mathcal{M} = \text{sum of over Feynman graphs}$$
So as I explained above only the $i$'s in the $i\epsilon$ are relevant to find the imaginary part of the amplitude.
