Speed of man $(m) = 8\;km/h$
Let the speed of stream be $s$
According to the question:
Speed of man upstream $= S_1 = m-s$
Speed of man downstream $= S_2 = m+s$
Speed = Distance/Time
Here, since the distance $D$ is same,
$D = S_1 \times T_1 = S_2 \times T_2$
$S_1 \times T_1 = S_2 \times T_2$
$\implies \frac{S_1}{S_2} = \frac{T_2}{T_1} = 1/3$
$m+s = 3(m-s)$
or, $8+s=3(8-s)$
$\implies s=\; 4\;km/h$