Let $a_n$ be the integer closest to $\sqrt{n}$. Find the sum $$\frac{1}{a_1} + \frac{1}{a_2} + \cdots + \frac{1}{a_{1980}}.$$

Let's think step by step and output the final answer within \boxed{}.
user