Q. Triangular Collection
题号:NC223981
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

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

输入描述:

The first line of input contains a single integer n (1 ≤ n ≤ 50), which is the number of integers inthe set. 
Each of the the next n lines contains a single integer x (1 ≤ x ≤ 109 ). These are the elements ofthe set. They are guaranteed to be distinct.

输出描述:

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

输入

复制
5
3
1
5
9
10

输出

复制
2
示例2

输入

复制
10
27
26
17
10
2
14
1
12
23
39

输出

复制
58