The function f is defined on the set of integers and satisfies

\(f(n)=\left\{\begin{matrix} n-3 & n\geq1000, \\f(f( n+5)) & n< 1000. \end{matrix}\right.\)

Find f(84).

(第二届AIME1984 第七题)