How many solutions $x_1+\dots+x_8=30$ has? 
Enumerate the solutions of
  $$x_1+\dots+x_8=30$$
  where $2\leq x_i\leq 5$ for $i=1,\dots,6$,
  and $x_7$ and $x_8$ must be or 5 or 10.

I am not sure with my process. 
and I would like to ask you if you have a better way to solve this?
and if I am right.
$S_0 - S_1 + S_2 - S_3\dots$ etc. is the solution. 
but i think im doing something wrong:
my solution

A possible way is using generating functions:


*

*First set $y_i = x_i-2$ for $i=1,\ldots , 6$ and $y_i = x_i -5$ for $i=7,8$. So, you look for the number of solutions of 
$$\mbox{}y_1 + \cdots + y_6 + y_7 + y_8 = 8 \mbox{ with } 0\leq y_i \leq 3 \;(i=1,\ldots ,6) \mbox{ and } y_i \in \{0,5\}\;(i=7,8)$$

*So you look for the coefficient of $x^8$ of the generating function of this problem (look at the exponents): $$(1+x+x^2+x^3)^6(1+x^5)^2 = \left(\frac{1-x^4}{1-x}\right)^6(1+x^5)^2$$

*Using $\frac{1}{(1-x)^6} = \sum_{n=0}^{\infty}\binom{n+5}{5}x^n$ (which can easily be verified by repeated differentiation), you get
\begin{eqnarray*} [x^8]\left(\frac{1-x^4}{1-x}\right)^6(1+x^5)^2
& = & [x^8](1-6x^4+\binom{6}{2}x^8)(1+2x^5)\sum_{n=0}^{\infty}\binom{n+5}{5}x^n \\
& = & [x^8](1-6x^4+2x^5 + \binom{6}{2}x^8)\sum_{n=0}^{\infty}\binom{n+5}{5}x^n \\
& = & \binom{8+5}{5} - 6\binom{4+5}{5} + 2\binom{3+5}{5} + \binom{6}{2}\\
& = & \boxed{658}
\end{eqnarray*}
