I have 6 boxes: $A,B,A',B',C \text{ and } D$. The box $A$ has $n_1$ red balls that are numbered from $1, \cdots, n_1$. The box $B$ has $n_2$ green balls that are numbered from $1, \cdots, n_2$. Make a copy version of these boxes $A,B$ are $A',B'$ (It means the box $A'$ has $n_1$ red balls from $1, \cdots, n_1$, and the box $B'$ has $n_2$ green balls from $1, \cdots, n_2$ ). These two boxes $C,D$ have no balls. Let $p$ be loss probability when we throw balls from a box to another box (each ball gets dropped with independent probability $p$). (For example, if we throw a ball from the box $A$ to box $C$ with loss prob. is $p=10\%$, then $90\%$ the ball will not drop. Then expected number of received ball in box $C$ will be $0.9n_1$ balls...).
First, I will throw these balls from $A$ and $B$ to the box $C$ with loss probability is $p$. Call number of red and green balls in box $C$ are $n_{1C},n_{2C}$, respectively. Then, randomly select $r$ balls from the box $C$, with $0 \le r \le \min(n_1,n_2,n_{1C}+n_{2C})$. Throw these $r$ balls to the box $D$ with loss probability $p$.
Second, throw these balls from these boxes $A',B'$ to the box $D$ with loss probability $p$.
How many (expected number) red balls do we have in the box $D$ in term of $p$, if two red balls have the same number (i.e number 4 of a red ball from $A' \to D$, and number 4 of a red ball from $C \to D$), then the red ball only counts 1 time? In the same manner, how many green balls do we have in the box $D$? Thank you in advance.