Since $\theta$ is the Heaviside step function, we know that
$$\theta(x)=\begin{cases} 1, &x>0 \\
\frac{1}{2},
&x=0\\ 0, &x<0
\end{cases}$$
Then we have that
$$\begin{align*} S(m) &= \sum_{n=0}^{-\infty} \theta(m+n)\theta(-n) \\
&= \sum_{n=0}^\infty \theta(m-n)\theta(n)\\
&= \theta(m-0)\underbrace{\theta(0)}_{=1/2} + \theta(m-1)\theta(1) + \cdots + \theta(m-(m-1))\theta(m-1) + \underbrace{\theta(m-m)}_{=1/2}\theta(m) + \underbrace{\theta(m-(m+1))}_{=0}\theta(m+1) + \cdots\\
&= \frac{1}{2} + \underbrace{1 + 1 + \cdots + 1}_{m-1 \text{ times}} + \frac{1}{2} + 0 \\
&= \frac{1}{2} + m-1+\frac{1}{2}\\
&=m
\end{align*}$$