The way the question is currently stated, Sam winds up 20km from the starting point.
Call the starting point $A$.
Sam goes $\sqrt{12.5}$km west and gets to a point we'll call $B$.
Sam goes $\sqrt{12.5}$km north and gets to a point we'll call $C$.
Now $ABC$ is an isosceles right triangle with right angle at $B$ (we are ignoring curvature of the Earth here, and treating it as a plane. If Sam started $\sqrt{12.5}$km south of the North Pole, all bets are off). By Pythagoras, $A$ is 5km southeast of $C$. So if Sam now goes 25km to the southeast, he goes 20km past $A$, winding up 20km from the starting point.