Hi guys, im working through some chemistry problems and i have zero math ability. Part of my problem requires me to Work out two values

for e.g

0.616 = A / B

A + B = 0.3

Its to work out the concentrations of an acid and a base in a chemical reaction. This is the part im stuck on. I know A divided by B = 0.616 and i know that if you add A + B together it comes to 0.3

Is there a method to work this out. In the book it gives this but i don't under stand where it gets some of the numbers from.

HPO4 (is just the chemical name)

0.616 x (0.3m -[HPO4] = [HPO4])

0.185 - 0.616 x [HPO4] = [HPO4]

0.185 = 1.616 x [HPO4]

0.114m = HPO4

So A = 0.114 and B = 0.186

I dont understand what they are doing to get the concentration....Can someone explain in simple terms?

Thanks