URI Online Judge | 1472
# Triangles

**Timelimit: 1**

Maratona de Programação da SBC Brasil

It will be give to you N points on a circle. You must write a program to determine how many distinct equilateral triangles can be constructed using the given points as vertices.

The figure below illustrates an example: (a) shows a set of points, determined by the lengths of the circular arcs that have adjacent points as extremes; and (b) shows the two triangles which can be built with these points.

The input contains several test cases and ends with EOF. The first line of a test case contains an integer **N** ( 3 ≤ **N** ≤ 10^{5}), the number of points given. The second line contains **N **integers **X*** _{i }*(1 ≤

For each test case your program must output a single line, containing a single integer, the number of distinct equilateral triangles that can be constructed using the given points as vertices.

Sample Input | Sample Output |

8 |
2 |