#t289. 和数

和数

Sum of Two Others

Problem Background

Special for beginners, ^_^

Problem Description

Given a sequence of positive integers, count how many of them are equal to the sum of two other numbers in the sequence. For example, for the sequence 1 2 3 41\ 2\ 3\ 4, the answer is 22, because 3=2+13 = 2 + 1 and 4=1+34 = 1 + 3.

Input Format

Two lines in total. The first line is the number nn (1≤n≤1001 \le n \le 100) of elements in the sequence. The second line contains the nn positive integers (each not greater than 1000010000) forming the sequence, separated by a single space.

Output Format

One integer: the number of elements in the sequence that equal the sum of two other elements.

Sample Input

4
1 2 3 4

Sample Output

2

Constraints

Time limit: 1s, memory limit: 1024KiB for each test case.