Hide

Problem H
Almost Pythagorean

Languages en is

You are given a non-negative integer n and should print the number of integer triples (a,b,c) that satisfy 0abcn and a2+b2=c2+c.

Input

The first and only line of input contains a non-negative integer n105.

Output

Print the number of integer triples (a,b,c) that satisfy 0abcn and a2+b2=c2+c.

Sample Input 1 Sample Output 1
10
5
Hide

Please log in to submit a solution to this problem

Log in