#include<bits/stdc++.h>
using namespace std;
int a[1005],n,s,x;
int main() {
cin>>n;
for(int i=0; i<n; i++)
cin>>a[i];
for(int i=0; i<n; i++) {
for(int j=0;j<n;j++)
{
for(int k=0;k<n;k++)
{
if(k!=j && a[j]+a[k]==a[i]){
s++;
x=1;
break;
}
}
if(x==1)break;
x=0;
}
}
cout<<s;
return 0;
}
c++
why!!!