Designate "x" as your amount of grams that you need to add.
If you have n% salt solution and m grams total, you have m*(n%) grams of salt, = m*(n/100) g of salt.
Then if you add "x" amount to m*(n/100) g of salt and then divide by the total amount, you should get a p/100 concentration.
So...
[x+m*(n/100)]/(x+m) = p/100
The reason why you divide the total amount of salt by x+m and not m is because you're adding x grams to the total amount m, so the total amount has to change.
So then if you work it out:
[x+m*(n/100)] = (p*(m+x))/100
Isolate the x variable by itself:
x = (m*p + x*p)/100 - m*(n/100)
x - (x*p)/100 = (m*p)/100 - m*(n/100)
x(1 - p/100) = (m*p - m*n)/100
x(100 - p) = m*p - m*n <--- Multiply both sides by 100
x = (m*p - m*n)/(100-p) = m(p-n)/(100-p)
Tough problem, but good practice. Let me know if you're confused about any of the steps above.