We have some urns (u1 u2 u3 u4) with different number of red and black balls (r1 b1), (r2 b2)... and we select one ball from each

1.The number of ways to get all 4 balls red is r1*r2*r3*r4 .

2.The number of ways to have 3 reds and 1 black is r1*r2*r3*b4 +r1*r2*b3*r4+r1*b2*r3*r4+b1*r2*r3*r4.

3.The number of ways to have 2 reds and 2 blacks is r1*r2*b3*b4 +r1*b2*r3*b4 + ... + b1*b2*r3*r4.

So it's easy to count combinations with n reds and m blacks.

My problem is slightly different: each urn has red, black and some balls we dont know the color yet - red or black (r, b, q) .

1.The number of ways that my combination is possible to have all red is (r1+q1)*(r2+q2)*(r3+q3)*(r4+q4) because we count the unknown color as possible red.

I want to find the number of ways that my combination is possible to have m reds and n blacks for this version.