Can somebody help me with this?

Question

If the ratio of the ages of two friends A and B is in the ratio 3 : 5 and that of B and C is 3 : 5 and the sum of their ages is 147, then how old is B?

1. 15 years

2. 75 years

3. 49 years

4. 45 years

5. 27 years

The answer is 45 years, but what is the correct approach to solve it?