We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

- All Contests
- ProjectEuler+
- Project Euler #91: Right triangles with integer coordinates

# Project Euler #91: Right triangles with integer coordinates

# Project Euler #91: Right triangles with integer coordinates

Contest ends in

_{This problem is a programming version of Problem 91 from projecteuler.net}

The points and are plotted at integer co-ordinates and are joined to the origin, , to form .

There are exactly fourteen triangles containing a right angle that can be formed when each co-ordinate lies between and inclusive; that is, .

Given that , how many right triangles can be formed?

**Input Format**

First and only line contains .

**Constraints**

**Output Format**

Output the required count.

**Sample Input**

```
2
```

**Sample Output**

```
14
```