I I U  O N L I N E   C O N T E S T   2 0 0 8

Problem B: Triples

Input: standard input
Output: standard output

 

Given a sequence of positive integers. You need to find the number of triples in that sequence. For this problem, (x, y, z) constructs a triple if and only if x + y = z. So, (1, 2, 3) is a triple, where (3, 4, 5) is not.

 

Input

Each input set starts with a positive integer N. Next few lines contain N positive integers. Input is terminated by EOF.

 

Output

For each case, print the number of triples in a line.

 

Constraints

-           3 ≤ N ≤ 5000

 

Sample Input

Output for Sample Input

6

1 2 3 4 5 6

6

1 2 4 8 16 32

3

100000000 200000000 100000000

5

1 1 1 2 2

6

0

1

6

 

Problem setter: Md. Kamruzzaman