Let $r=\sqrt{n+\sqrt{2016}}+\sqrt{m-\sqrt{2016}}$. Then

$$
n+m+2 \sqrt{n+\sqrt{2016}} \cdot \sqrt{m-\sqrt{2016}}=r^{2}
$$

and

$$
(m-n) \sqrt{2106}=\frac{1}{4}\left(r^{2}-m-n\right)^{2}-m n+2016 \in \mathbb{Q}
$$

Since $\sqrt{2016} \notin \mathbb{Q}$, it follows that $m=n$. Then

$$
\sqrt{n^{2}-2016}=\frac{1}{2}\left(r^{2}-2 n\right) \in \mathbb{Q}
$$

Hence, there is some nonnegative integer $p$ such that $n^{2}-2016=p^{2}$ and (1) becomes $2 n+2 p=r^{2}$.

It follows that $2(n+p)=r^{2}$ is the square of a rational and also an integer, hence a perfect square. On the other hand, $2016=(n-p)(n+p)$ and $n+p$ is a divisor of 2016, larger than $\sqrt{2016}$. Since $n+p$ is even, so is also $n-p$, and $r^{2}=2(n+p)$ is a divisor of $2016=2^{5} \cdot 3^{2} \cdot 7$, larger than $2 \sqrt{2016}>88$. The only possibility is $r^{2}=2^{4} \cdot 3^{2}=12^{2}$. Hence, $n+p=72$ and $n-p=28$, and we conclude that $n=m=50$. Thus, there is only one such pair.
Determine the number of pairs of integers $(m, n)$ such that

$$
\sqrt{n+\sqrt{2016}}+\sqrt{m-\sqrt{2016}} \in \mathbb{Q}
$$