How is this exactly equal to $N_1+N_2+\dots+N_r$? 
There are $N$ boxes, each containing at most $r$ balls. If the number of boxes containing at least $i$ balls is $N_i$ for $i=1,2,\dots,r,$ then the total number of balls contained in these $N$ boxes is exactly equal to $N_1+N_2+\dots+N_r.$

How is that exactly equal to $N_1+N_2+\dots+N_r$?
I can't understand why statement containing at least and at most turn to give this exact answer!
I tested for $N=4$ and $r=3$. Suppose that box 1 has 3 balls, box 2 has 2 balls, box 3 has 1 ball and box 4 has 3 balls. So, $N_1=4,N_2=3,N_3=2$ and the conclusion holds!
 A: If a box contains $b$ balls, then it is counted into $N_1, N_2, \ldots, N_b$. For example a box with $3$ balls has "at least three balls", so it is counted in $N_3$, but it also has "at least two balls" and "at least one balls", so it also counted in $N_2$ and $N_1$ respectively. So you count each box as many times as is the number of balls the box contains.
A: Note that the number of boxes that contains exactly $j$ balls is $N_j-N_{j+1}$. Then, the total number of balls is
$$\sum_{j=1}^r j(N_j-N_{j+1})=\sum_{j=1}^{r+1}N_j(j-(j-1))=\sum_{j=1}^rN_j$$
since $N_{r+1}=0$.
A: It is given that $N_1$ is the number of boxes with at least $1$ ball and $N_2$ is the number of boxes with at least $2$ balls, then we can certainly conclude that the total number of boxes with exactly $1$ ball is $N_1-N_2$. Now ball contribution to the total number of balls by these $N_1-N_2$ boxes is equal to $1\times(N_1-N_2).$ 
Again, we have that $N_2$ is the number of boxes with at least $2$ balls and $N_3$ is the number of boxes with at least $3$ balls, then we can certainly conclude that the total number of boxes with exactly $2$ balls is $N_2-N_3$. Now ball contribution to the total number of balls by these $N_2-N_3$ boxes is equal to $2\times(N_2-N_3).$ 
Going on like this we can conclude that the total number of boxes having exactly $n$ balls is equal to $N_{n}-N_{n+1}$, $\forall$ $1\le n\le r-1$. Therefore ball contribution to the total number of balls by these $N_{n}-N_{n+1}$ boxes is equal to $n\times(N_{n}-N_{n+1})$. 
Now the total number of boxes having at least $r$ balls is $N_r$. But, since we are provided with the constrain that each of the $N$ boxes contains at most $r$ balls, we can conclude that the total number of boxes having exactly $r$ balls is $N_r$, and ball contribution by these $N_r$ boxes is $r\times N_r$. 
Therefore, total number of balls contained in these $N$ boxes is $$\sum_{i=1}^{r-1}(N_i-N_{i+1})i+rN_r=N_1+N_2+N_3+...+N_r.$$ 
