Squares

Input file: sqr.in
Output file: sqr.out

An integer n may be represented as the sum of four squares of non-negative integers. Write a program to find out how many vectors (a,b,c,d) exist such that 0 <= a <= b <= c <= d and n = a2 + b2 + c2 + d2.

Each line of the input file will have one postive integer. Your program should compute the number of vectors (a,b,c,d) for which the above equation is satisfied. Your program will output each result on a separate line of the output file.

No line will contain more than 100 characters. No input value of n will be less that 1 or greater than 10,000.

Sample Input

4
12
49

Sample Output

5
8
44

Note: The above sample output is generated assuming that 0<= a, b, c, d rather than 0 <= a <= b <= c <= d. Either solution was accepted as a correct one.


Original source unknown