Given three indentical bags each containing 10 balls, whose colours are as follows :
| Red | Blue | Green | |
|---|---|---|---|
| Bag I | 3 | 2 | 5 |
| Bag II | 4 | 3 | 3 |
| Bag III | 5 | 1 | 4 |
A person chooses a bag at random and takes out a ball. If the ball is Red, the probability that it is from bag I is p and if the ball is Green, the probability that it is from bag III is q, then the value of is :