#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 , the answer is , because and .
Input Format
Two lines in total. The first line is the number () of elements in the sequence. The second line contains the positive integers (each not greater than ) 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.