Quadroquadratures#672

Quadroquadratures

1 second
64 megabytes
Medium

An ordered quadruple of natural numbers (a, b, c, d) is called a quadroquadrature of a natural number if the following equation holds:

a^2 + b^2 + c^2 + d^2 = N

Quadroquadratures that differ in the order of the numbers are considered distinct.

Write a program that determines the number of quadroquadratures for a given natural number .

Input

The input file contains a single natural number (1 \leq N \leq 1000000).

Output

Print a single number—the number of quadroquadratures of .

Examples

Example 1

Loading
Loading