You are given a sequence consisting of integers. We will call the sequence element good if it equals the sum of some three elements in positions strictly smaller than (an element can be used more than once in the sum).
How many good elements does the sequence contain?
Input Specification
The first line of input contains the positive integer , the length of the sequence .
The second line of input contains space-separated integers representing the sequence .
Output Specification
The first and only line of output must contain the number of good elements in the sequence.
Scoring
In test data worth at least of total points, .
In test data worth at least of total points, .
Sample Input 1
2
1 3
Sample Output 1
1
Sample Input 2
6
1 2 3 5 7 10
Sample Output 2
4
Sample Input 3
3
-1 2 0
Sample Output 3
1
Comments