Let $f(n)$ be the integer closest to $\sqrt{n}$. Compute the largest $N$ less than or equal to $2018$ such that $\sum_{i=1}^N\frac{1}{f(i)}$ is integral.

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