#include <bits/stdc++.h>
using namespace std;

int main() {
	int arr[]= {10, 5, 1, 3, 1};
	int n=sizeof(arr)/sizeof(arr[0]);
	int diff=2;
	int count=0;
	unordered_map<int, int> mp;
	for(int j=0;j<n;j++){
		if(mp.find(diff-arr[j])!=mp.end())
			count=count+mp[diff-arr[j]];
		if(mp.find(-diff-arr[j])!=mp.end())
			count=count+mp[-diff-arr[j]];
		mp[arr[j]]++;
	}
	cout<<count;
	return 0;
}
