we have the following:
speed of the boat in still water be x
the speed of the stream is 5 km/h
upstream
[tex]\begin{gathered} speed=x-5 \\ d=s\cdot t \\ d=(x-5)\cdot4 \\ \end{gathered}[/tex]downstream:
[tex]\begin{gathered} speed=x+5 \\ d=s\cdot t \\ d=(x+5)\cdot3 \\ \end{gathered}[/tex]therefore:
[tex]\begin{gathered} (x-5)\cdot4=(x+5)\cdot3 \\ 4x-20=3x+15 \\ 4x-3x=15+20 \\ x=35 \end{gathered}[/tex]The answer is 35 km/h