A bag contains only red, green and white balls. The probability of selecting a red ball from the bag at random is \(\frac{1}{3}\) and that of selecting a white ball at random is \(\frac{1}{2}\). If the bag contains 9 green balls, the total number of balls in the bag is:
1
45
2
48
3
42
4
54