Suppose we flip a coin a random number $N$ of times, where $P(N = n) = (e^{-r})\frac{r^n}{n!}\qquad n = 0,1,2,\ldots$ that is, $N$ has a Poisson distribution. The flips are independent, and the probability of seeing heads is equal to p. Hence if we know that $N = n$, the number of heads is simply the number of heads in $n$ coin flips with success probability $p$. We write $X$ for the total number of heads, and $Y$ for the total number of tails, so $X +Y = N$.
Question: Why is $P(X=x) = \sum_{n\geq x} P(X=x|N=n)P(N=n)\quad ?$ Also, how does one calculate this sum?