rate of motorboat: b
rate of current: c
So the rate the boat travels upstream is $b - c$, and the rate it travels downstream is $b + c$





Adding these equations, we get:


So

Therefore the rate of the boat is 45kph, and the rate of the current is 5kph
Hope this helps :)