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!