2020 South Central USA Regional Contest

Start

2021-03-06 10:00 CET

2020 South Central USA Regional Contest

End

2021-03-06 15:00 CET
The end is near!
Contest is over.
Not yet started.
Contest is starting in -2 days 9:29:26

Time elapsed

5:00:00

Time remaining

0:00:00

Problem N
Triangular Collection

Call a set of positive integers triangular if it has size at least three and, for all triples of distinct integers from the set, a triangle with those three integers as side lengths can be constructed.

Given a set of positive integers, compute the number of its triangular subsets.

Input

The first line of input contains a single integer $n$ ($1 \le n \le 50$), which is the number of integers in the set.

Each of the the next $n$ lines contains a single integer $x$ ($1 \le x \le 10^9$). These are the elements of the set. They are guaranteed to be distinct.

Output

Output a single integer, which is the number of triangular subsets of the given set.

Sample Input 1 Sample Output 1
5
3
1
5
9
10
2
Sample Input 2 Sample Output 2
10
27
26
17
10
2
14
1
12
23
39
58