#P32. [KBC001G] ABC

[KBC001G] ABC

Source

This problem is adapted from Long Long OJ. All rights reserved.

Description

Given an integer nn, find all valid pairs (a,b,c)(a,b,c) consisting of three integers that satisfy the following conditions:

  • 1a<b<cn1 \leq a \lt b \lt c\leq n
  • a2+b2=c2a^{2}+b^{2}=c^{2}

Input

An integer nn.

Output

Output the sum of cc over all the valid pairs (a,b,c)(a,b,c).

Samples

5
5
20
80

Tips

Sample Explanation 2:

The valid pairs are: $(3,4,5),(6,8,10),(5,12,13),(9,12,15),(8,15,17),(12,16,20).$

As a result, the answer is 5+10+13+15+17+20=80.5+10+13+15+17+20=80.


For 100%100\% of the testcases, 1n1061\leq n\leq 10^6.