Sanggeun and Seonyeong are playing a number-guessing game. First, Sanggeun picks two positive integers $A$ and $B$ with $1 \le B \le A \le 500$. Seonyeong must then guess the numbers Sanggeun picked.
Sanggeun gives Seonyeong the following hint:
The square of $A$ is exactly $N$ greater than the square of $B$. ($1 \le N \le 1{,}000$)
In other words, $A^2 - B^2 = N$. For the given $N$, write a program that counts the number of ordered pairs $(A, B)$ satisfying this condition.
The first line contains an integer $N$. ($1 \le N \le 1{,}000$)
Print, on one line, the number of ordered pairs $(A, B)$ that satisfy both the hint condition $A^2 - B^2 = N$ and $1 \le B \le A \le 500$.