Quadroquadratures
Medium
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
An ordered quadruple of natural numbers (a, b, c, d) is defined as a quad-square of a natural number N if it satisfies the following equation:
[ a^2 + b^2 + c^2 + d^2 = N ]
Quad-squares are considered distinct if they differ in the sequence of numbers.
Write a program to determine the number of quad-squares for a given natural number N.
Input
The input consists of a single natural number N (1 ≤ N ≤ 1000000).
Output
Output a single number, which is the count of quad-squares for the number N.
Examples
Input #1
Answer #1
Submissions 155
Acceptance rate 25%