Five. (20 points) A scientific expedition team went to the upper reaches of a certain river to investigate an ecological area. After setting out, they advanced at a speed of $17 \mathrm{~km}$ per day, traveling upstream along the riverbank for several days before reaching their destination. They then spent several days investigating the ecological area. After completing their mission, they returned at a speed of 25 $\mathrm{km}$ per day. On the 60th day after departure, the expedition team traveled $24 \mathrm{~km}$ and returned to the starting point. How many days did the scientific expedition team spend investigating the ecological area?
Let the expedition team took $x$ days to reach the ecological area, $y$ days to return, and spent $z$ days on the investigation. Then,
$$
x+y+z=60,
$$

and $17 x-25 y=-1$ or $25 y-17 x=1$.
(Here $x, y$ are positive integers)
First, find a special solution $\left(x_{0}, y_{0}\right)$ of equation (1) (here $x_{0}, y_{0}$ can be negative integers). Using the Euclidean algorithm, we have
$$
25=1 \times 17+8,17=2 \times 8+1 \text {. }
$$

Thus, $1=17-2 \times 8=17-2 \times(25-17)$
$$
=3 \times 17-2 \times 25 \text {. }
$$

Comparing with the left side of equation (1), we get
$$
x_{0}=-3, y_{0}=-2 \text {. }
$$

Next, find the solution of equation (1) that meets the problem's requirements.
It is easy to see that all integer solutions of equation (1) can be expressed as
$$
x=-3+25 t, y=-2+17 t \text {. }
$$

Then $x+y=42 t-5, t$ is an integer.
According to the problem, $0<x+y<60$, so only when $t=1$ does it meet the requirements, at this time $x+y=42-5=37$.
Thus, $z=60-(x+y)=23$.