#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
using namespace std;



int main()
{
	int n; 
    cin >> n;

    vector<long long> ref(200, 0);
    vector<int> arr(n);
    rep(i, n) {
        cin >> arr[i];
        ref[arr[i] % 200]++;
    }

    long long ans = 0;
    rep(i, 200) ans += ref[i]*(ref[i]-1) / 2;
        
    cout << ans << endl;
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,ans;
int main(){
	cin>>n;
	for(ll i=1;i*i<=n+n;i++){
		ll S=n+n-i*(i-1);
		if(S%(i+i)!=0)continue;
		ll l=S/(i+i);
		if(l<=0)continue;
		ans++;
	}
	ans<<=1;
	cout<<ans<<endl;
	return 0;
} 