Given that $(1+\sin t)(1+\cos t)=5/4$ and \[ (1-\sin t)(1-\cos t)=\frac mn-\sqrt{k}, \] where $k, m,$ and $n$ are positive integers with $m$ and $n$ relatively prime, find $k+m+n.$
1. Given the equations:
   \[
   (1+\sin t)(1+\cos t) = \frac{5}{4}
   \]
   and
   \[
   (1-\sin t)(1-\cos t) = \frac{m}{n} - \sqrt{k},
   \]
   we need to find the values of \(k\), \(m\), and \(n\) such that \(k + m + n\) is maximized.

2. First, expand the given product:
   \[
   (1+\sin t)(1+\cos t) = 1 + \sin t + \cos t + \sin t \cos t = \frac{5}{4}.
   \]

3. Similarly, expand the second product:
   \[
   (1-\sin t)(1-\cos t) = 1 - \sin t - \cos t + \sin t \cos t = c.
   \]

4. Let \(c = \frac{m}{n} - \sqrt{k}\). We now have two equations:
   \[
   1 + \sin t + \cos t + \sin t \cos t = \frac{5}{4},
   \]
   and
   \[
   1 - \sin t - \cos t + \sin t \cos t = c.
   \]

5. Adding these two equations:
   \[
   (1 + \sin t + \cos t + \sin t \cos t) + (1 - \sin t - \cos t + \sin t \cos t) = \frac{5}{4} + c,
   \]
   \[
   2 + 2 \sin t \cos t = \frac{5}{4} + c.
   \]

6. Subtracting the second equation from the first:
   \[
   (1 + \sin t + \cos t + \sin t \cos t) - (1 - \sin t - \cos t + \sin t \cos t) = \frac{5}{4} - c,
   \]
   \[
   2 (\sin t + \cos t) = \frac{5}{4} - c.
   \]

7. Let \(x = \sin t + \cos t\). Then:
   \[
   2 + 2 \sin t \cos t = \frac{5}{4} + c,
   \]
   \[
   2 \sin t \cos t = \frac{5}{4} + c - 2,
   \]
   \[
   \sin t \cos t = \frac{\frac{5}{4} + c - 2}{2} = \frac{-3/4 + c}{2} = \frac{c - 3/4}{2}.
   \]

8. Also:
   \[
   2x = \frac{5}{4} - c,
   \]
   \[
   x = \frac{\frac{5}{4} - c}{2} = \frac{5/4 - c}{2}.
   \]

9. Using the identity \((\sin t + \cos t)^2 = \sin^2 t + \cos^2 t + 2 \sin t \cos t\):
   \[
   x^2 = 1 + 2 \sin t \cos t,
   \]
   \[
   \left(\frac{5/4 - c}{2}\right)^2 = 1 + 2 \left(\frac{c - 3/4}{2}\right),
   \]
   \[
   \left(\frac{5/4 - c}{2}\right)^2 = 1 + \frac{c - 3/4}{1},
   \]
   \[
   \left(\frac{5/4 - c}{2}\right)^2 = 1 + c - 3/4,
   \]
   \[
   \left(\frac{5/4 - c}{2}\right)^2 = \frac{4 + 4c - 3}{4},
   \]
   \[
   \left(\frac{5/4 - c}{2}\right)^2 = \frac{1 + 4c}{4}.
   \]

10. Simplifying:
    \[
    \left(\frac{5/4 - c}{2}\right)^2 = \frac{1 + 4c}{4},
    \]
    \[
    \frac{(5/4 - c)^2}{4} = \frac{1 + 4c}{4},
    \]
    \[
    (5/4 - c)^2 = 1 + 4c,
    \]
    \[
    \left(\frac{5}{4} - c\right)^2 = 1 + 4c.
    \]

11. Solving the quadratic equation:
    \[
    \left(\frac{5}{4} - c\right)^2 = 1 + 4c,
    \]
    \[
    \frac{25}{16} - \frac{5c}{2} + c^2 = 1 + 4c,
    \]
    \[
    16c^2 - 40c + 25 = 16 + 64c,
    \]
    \[
    16c^2 - 104c + 9 = 0.
    \]

12. Solving for \(c\) using the quadratic formula:
    \[
    c = \frac{104 \pm \sqrt{104^2 - 4 \cdot 16 \cdot 9}}{2 \cdot 16},
    \]
    \[
    c = \frac{104 \pm \sqrt{10816 - 576}}{32},
    \]
    \[
    c = \frac{104 \pm \sqrt{10240}}{32},
    \]
    \[
    c = \frac{104 \pm 32\sqrt{10}}{32},
    \]
    \[
    c = 3.25 \pm \sqrt{10}.
    \]

13. Since \((1-\sin t)(1-\cos t)\) has a maximum of 4, we choose the smaller value:
    \[
    c = 3.25 - \sqrt{10}.
    \]

14. Therefore:
    \[
    \frac{m}{n} - \sqrt{k} = 3.25 - \sqrt{10},
    \]
    \[
    \frac{13}{4} - \sqrt{10}.
    \]

15. Thus, \(m = 13\), \(n = 4\), and \(k = 10\). Therefore:
    \[
    k + m + n = 10 + 13 + 4 = 27.
    \]

The final answer is \(\boxed{27}\).