Answer:
Let x be the number of sweets that Ryan has.
Since the ratio of the number of sweets Mary has to the number Ryan has is 3:2, we can say that Mary has 3/2*x sweets.
We know that if Mary gave 5 sweets to Ryan they would have the same number of sweets, so we can write the following equation:
3/2*x -5 = x
By solving this equation, we can find that x = 10. So, Ryan has 10 sweets
Therefore, Mary has 3/2*10 = 15 sweets.
Altogether, Mary and Ryan have 15+10 = 25 sweets.