#include <bits/stdc++.h>
#define int long long
using namespace std;
int n, a[100005], sum = 0;
bool book[20005];
signed main()
{
ios::sync_with_stdio(0);
cin >> n;
for(int i = 1; i <= n; i++)
{
cin >> a[i];
book[a[i]] = true;
}
for(int i = 1; i <= n; i++)
{
for(int j = 1; j <= n; j++)
{
if(a[i] == 2 * a[j]) continue;
if(book[a[i] - a[j]] == true)
{
sum++;
break;
}
}
}
cout << sum << endl;
return 0;
}
WA on #2 #6 #7 #8 #9 #10