6. Given the sequence $\left\{a_{n}\right\}$

satisfies
$$
a_{n}=\sqrt{1+\frac{1}{n^{2}}+\frac{1}{(n+1)^{2}}}(n \geqslant 1),
$$

and its first $n$ terms sum is $S_{n}$. Then $\left[S_{n}\right]=$ $\qquad$ ( [ $x$ denotes the greatest integer not exceeding the real number $x$ ).