From the given we can conclude these equations:
Let A= number of medals of team A; B= number of medals of team B
3/4A = 2/3B
A= B - 5
Substitute second equation to first equation.
3/4A = 2/3B
3/4(B-5)= 2/3B
3/4B - 15/4 = 2/3B
0.0833B = 3.75
B = 45.018
B = 45
A = 40
Team A had 40 medals.