In how many different ways can apples be placed in the box if at least there is one apple of each color? 
Suppose there are $4$ red apples, $5$ green apples, and $6$ yellow apples, $9$ of them will be put into a box. In how many different ways can apples be placed in the box if at least there is one apple of each color?

I've tried to solve this problem and got the result of $673596$ different possible compositions. Here's how I try to solve it.
One apple of each color must be in the box, therefore the new sample space is that containing $3$ red apples, $4$ green apples and $5$ yellow apples $(3R, 4G, 5Y)$, and because there are already $3$ apples in the box, I just need to pick the remaining $6$ apples. 
The problem now reduced to how much partition of $12$ objects into $4$ part namely $R$ (for red apples), $G$ (for green apples), $Y$ (for yellow apples) and $N$ (for none of the three) are possible, which is.
$$\sum \binom{12}{R,G,Y,N}$$
for $R+G+Y = 6$, and $N = 6$.
My question is whether there is any some kind of generalization of this problem so that I could solve it easily without deliberately looking for every possible arrangement of $R$, $G$ and $Y$ (which is how I try to solve the problem).

The generating function for the number of ways to arrange $n$ apples is
$$
\begin{align}
&\left(x+x^2+x^3+x^4\right)\left(x+x^2+x^3+x^4+x^5\right)\left(x+x^2+x^3+x^4+x^5+x^6\right)\\
&=\frac{x-x^5}{1-x}\frac{x-x^6}{1-x}\frac{x-x^7}{1-x}\\
&=\left(x^3-x^7-x^8-x^9+x^{12}+x^{13}+x^{14}-x^{18}\right)\sum_{k=0}^\infty\binom{k+2}{k}x^k
\end{align}
$$
The coefficient of $x^n$ is
$$
\scriptsize\binom{n-1}{n-3}-\binom{n-5}{n-7}-\binom{n-6}{n-8}-\binom{n-7}{n-9}+\binom{n-10}{n-12}+\binom{n-11}{n-13}+\binom{n-12}{n-14}-\binom{n-16}{n-18}
$$
which is equal to
$$
\scriptsize\binom{n-1}{2}-\binom{n-5}{2}-\binom{n-6}{2}-\binom{n-7}{2}+\binom{n-10}{2}+\binom{n-11}{2}+\binom{n-12}{2}-\binom{n-16}{2}
$$
where the sum is only taken over the terms where the upper term is greater than or equal to the lower term.
For $n=9$, we get
$$
\binom{8}{2}-\binom{4}{2}-\binom{3}{2}-\binom{2}{2}=18
$$
