Relationship between pmf and cdf I have one problem about basic probability theory.

Let X be a random variable of the discrete type with pmf p(x) that is positive on the nonnegative integers and is equal to zero elsewhere. Show that 
$$
E(X) = \sum\limits_{x=0}^\infty [1-F(x)], 
$$
where F(x) is the cdf of X.

When I expand the right hand side (by substituting $F(x)$ with $p(1) + p(2) + ... + p(x)$), I can "see" that the right hand side turns out to be $1*p(1) + 2*p(2) + 3*p(3) + ... $ (which is exactly the expectation of X). However, I am having some trouble formalizing this idea (i.e., proving the equation above formally). 
Can someone please help me ?
Thanks.

Let $f:\mathbb Z_{\geq0}^2\rightarrow\{0,1\}$ be prescribed by $\langle n,k\rangle\mapsto1$ if $k>n$ and $\langle n,k\rangle\mapsto0$ otherwise.
$$\sum_{n=0}^{\infty}(1-F(n))=\sum_{n=0}^{\infty}\sum_{k=0}^{\infty}p(k)f(n,k)=\sum_{k=0}^{\infty}\sum_{n=0}^{\infty}p(k)f(n,k)=\sum_{k=0}^{\infty}p(k)\sum_{n=0}^{\infty}f(n,k)=\sum_{k=0}^{\infty}p(k)k$$
