Number of non-negative solutions of an equation with restrictions 
Q: Find the number of non-negative solutions of the equation $$r_1+r_2+r_3+\ldots +r_{2n+1}=R$$ when $0 \le r_i \le \min(N,R)$  and  $0\le R\le (2n+1)N$.

My Attempt:
I tried the stars and bars method but it did not work properly. If the upper-bound for $r_i$ was not there, then the answer would have been $\binom{2n+1+R-1}{R}=\binom{2n+R}{R}$.
But how do I deal with this problem in the given situation?
EDIT: For the problem, you can simply consider $R$ as fixed and I wish to calculate the number of non-negative solutions to the given equation only.

Let $$A_k = \{(r_1,\cdots ,r_{2n+1}):\sum _{i\in[2n+1]} r_i=k,0\leq r_i \leq min \{N,k\}\},$$
So you want $$\sum _{k = 0}^{(2n+1)N}|A_k|,$$ notice that it does not matter the restriction $r_i\leq min \{N,k\}$ because $r_i\leq k$ so you just have to worry about $r_i\leq N.$ 
You will have to use inclusion exclusion in the following way:
Let $C_k = \{(r_1,\cdots ,r_{2n+1}):\sum _{i\in[2n+1]} r_i=k,r_i\geq 0\}$(all the possibilities) and $B_{k,j}=\{(r_1,\cdots , r_{2n+1}):r_{j}>N,\sum r_i=k\},$(the ones you do not want) so that you have $$A_k=C_k\setminus \bigcup _{j=1}^{2n+1} B_{k,j},$$
then by inclusion-exclusion principle you have 
$$|A_k|=|C_k|-\sum _{l = 1}^{2n+1}(-1)^{l-1}\sum _{a_1<a_2< \cdots <a_l}|\bigcap_{s\in [l]} B_{k,a_s}|,$$ it is clear that, by stars and bars argument (as you noticed), $|C_k|=\binom{k+2n}{2n}$ and intersection of the $B_{k,a_l}$ is just imposing conditions as follows, elements in $\bigcap_{s\in [l]} B_{k,a_s}$ look like $$(r_1,\cdots ,r_{a_1},\cdots ,r_{a_2},\cdots,r_{a_l},\cdots ,r_{2n+1})=(r_1,\cdots ,r^*_{a_1}+N+1,\cdots ,r^*_{a_2}+N+1,\cdots,r^*_{a_l}+N+1,\cdots ,r_{2n+1}),$$ so it is just a rename, namely, $r_{a_s}=N+1+r^*_{a_s}$ for the special ones and $r_i=r^*_i$ for the remaining (hence $0\leq r^*_{i}$).
So $$k=\sum _{i=1}^{2n+1}r_i=(N+1)l+\sum _{i=1}^{2n+1}r^*_i,$$ hence $k-(N+1)l=\sum _{i=1}^{2n+1}r^*_i$ so use stars and bars again and you will get it. By using also Hockey stick identity, answer should look like :
 $$\sum _{l=0}^{2n+1}(-1)^l\binom{2n+1}{l}\binom{(N+1)(2n+1-l)}{2n+1}.$$
EDIT: An intermediate step in between the answer for fixed $R$ and the answer for every $R$ is $$\sum _{k = 0}^{(2n+1)N}\underbrace{\sum _{l=0}^{2n+1}(-1)^l\binom{2n+1}{l}\binom{k-(N+1)l+2n}{2n}}_{\text{This would be the answer for fixed $R$}}$$
