Let $p$ and $q$ be positive integers such that $\frac{5}{8}<\frac{p}{q}<\frac{7}{8}$. What is the smallest value of $p$ for which $p+q=2005$?
Given $q=2005-p$, we have

$$
\frac{5}{8}<\frac{p}{2005-p}<\frac{7}{8}
$$

from which it follows that

$$
5(2005-p)<8 p \quad \text { and } 8 p<7(2005-p)
$$

Therefore,

$$
\frac{5 \times 2005}{13}<p<\frac{7 \times 2005}{15} \Rightarrow 771.15<p<935.66
$$

Thus, 772 is the smallest value of $p$ that satisfies the conditions of the problem.