A person rowing at the rate of 5 km/hr in still water, takes thrice as much time in going 40 km upstream as in going 40 km downstream. Find the speed of the stream.