<s>[INST] A boy named John threw $3$ dice. In how many ways he can get the sum $10$? 
A boy named John threw 3 dice. In how many ways can get the sum 10?

My Approach:
So there are 3 dice: $a, b, c$. Since they are dice, we can write: $1 \le a,b,c \le 6$. My equation right now is $$a+b+c=10$$ Now because, each die will roll at least a one, I subtract that from the total sum to remove the bound so my new equation has conditions $a,b,c \le 5$ and is $$a+b+c=7$$ Using stars and bars, I got the answer as $36$ but the correct answer is $36-9=27$. I want to know where the $9$ comes from.
Note: Please answer this using stars and bars
EDIT: The approach to my answer stems from this question
EDIT: stars and bars does not account for the upper bound restriction therefore, I needed to remove the $9$ other cases where either of $a, b, c$ exceeded $5$. These include the $6$ combinations of the case $6 + 1 + 0$ and the $3$ for $7+0+0$.
 [/INST] Not stars and bars, but an alternative:
You need the coefficient of $x^{10}$ in $(x+x^2 + x^3 + x^4 + x^5+x^6)^3$.
Write the latter expression as $x^3(1+x+ \ldots +x^5)^3$, so we need the coefficient of $x^7$ in $$(1+x+ \ldots +x^5)^3 = \left(\frac{1-x^6}{1-x}\right)^3 = (1-x^6)^3 (1-x)^{-3} = (1-3x^6 + 3x^{12} - x^{18})\sum_{k=0}^\infty \binom{k+2}{k}x^k$$ using the binomial series and standard expansions.
So for the coefficient of $x^7$ we get two terms: $\binom{9}{7} - 3\binom{3}{1} = 36 - 9$ which nicely corresponds with your answer.
</s>