Farmer Tim is lost in the densely-forested Cartesian plane. Starting from the origin he walks a sinusoidal path in search of home; that is, after $t$ minutes he is at position $(t,\sin t)$.
 
Five minutes after he sets out, Alex enters the forest at the origin and sets out in search of Tim. He walks in such a way that after he has been in the forest for $m$ minutes, his position is $(m,\cos t)$. 

What is the greatest distance between Alex and Farmer Tim while they are walking in these paths?
1. **Determine the positions of Tim and Alex at a given time \( t \):**
   - Tim's position at time \( t \) is \((t, \sin t)\).
   - Alex starts 5 minutes later, so at time \( t \), Alex has been walking for \( t - 5 \) minutes. Therefore, Alex's position at time \( t \) is \((t - 5, \cos (t - 5))\).

2. **Calculate the distance between Tim and Alex:**
   - The distance \( D \) between the points \((t, \sin t)\) and \((t - 5, \cos (t - 5))\) is given by the Euclidean distance formula:
     \[
     D = \sqrt{(t - (t - 5))^2 + (\sin t - \cos (t - 5))^2}
     \]
   - Simplify the expression:
     \[
     D = \sqrt{5^2 + (\sin t - \cos (t - 5))^2}
     \]
     \[
     D = \sqrt{25 + (\sin t - \cos (t - 5))^2}
     \]

3. **Maximize the expression \((\sin t - \cos (t - 5))^2\):**
   - Let \( f(t) = (\sin t - \cos (t - 5))^2 \).
   - To find the maximum value of \( f(t) \), we first need to find the maximum value of \(\sin t - \cos (t - 5)\).

4. **Analyze the function \(\sin t - \cos (t - 5)\):**
   - The trigonometric identity for the sum of angles can be used to simplify \(\cos (t - 5)\):
     \[
     \cos (t - 5) = \cos t \cos 5 + \sin t \sin 5
     \]
   - Therefore,
     \[
     \sin t - \cos (t - 5) = \sin t - (\cos t \cos 5 + \sin t \sin 5)
     \]
     \[
     = \sin t - \cos t \cos 5 - \sin t \sin 5
     \]
     \[
     = \sin t (1 - \sin 5) - \cos t \cos 5
     \]

5. **Maximize the expression:**
   - To maximize \((\sin t - \cos (t - 5))^2\), we need to find the critical points by taking the derivative and setting it to zero. However, this approach is complex due to the trigonometric terms.
   - Instead, we can use the fact that the maximum value of \(\sin t\) and \(\cos t\) is 1 and the minimum value is -1. Therefore, the maximum value of \(\sin t - \cos (t - 5)\) occurs when \(\sin t = 1\) and \(\cos (t - 5) = -1\) or vice versa.

6. **Evaluate the maximum distance:**
   - The maximum value of \(\sin t - \cos (t - 5)\) is \(\sqrt{2}\) when \(\sin t = 1\) and \(\cos (t - 5) = -1\).
   - Therefore, the maximum value of \((\sin t - \cos (t - 5))^2\) is \(2\).

7. **Calculate the greatest distance:**
   - Substitute the maximum value into the distance formula:
     \[
     D = \sqrt{25 + 2} = \sqrt{27} = 3\sqrt{3}
     \]

The final answer is \(\boxed{3\sqrt{3}}\)