#include<stdio.h>
int main(){
int numbers,i,a,x,m,n,lastresult,result;
int array[105];
scanf ("%d",&numbers);
for(i = 0;i < numbers;i++){ /*put numbers into array*/
scanf("%d",&a);
array[i]=a;
}
result = 0;
i--; /*let i stands for the size of array*/
/* x is set to stands for the sum of two numbers*/
for(x = 0;n < i;){
for(m = 0;m < i;m++){
for(n = 1;n < i;n++){
if(array[n] + array[m] == array[x])
lastresult = result;
result++;
x++;
}
}
if(lastresult == result){
x++;
}
}
printf("%d",result);
return 0;
}