Triples

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 6 123456 6 1 2 4 8 16 32 3 100000000 200000000 100000000 5 11122 Sample Output 6 0 1 6