#include<bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
#define swap(a,b) (a^=b^=a^=b)
#define ll long long int
#define ull unsigned long long int
#define uint unsigned int
#define format(a) memset(a,0,sizeof(a))
#define rep(x,y,z) for(int x=y;x<=z;x++)
#define dec(x,y,z) for(int x=y;x>=z;x--)
#define mst(x) memset(x,0,sizeof(x))
const int maxn=2e5+20;
inline int read()
{
    int ans=0;
    char last=' ',ch=getchar();
    while(ch<'0'|ch>'9')last=ch,ch=getchar();
    while(ch>='0' && ch<='9')ans=ans*10+ch-'0',ch=getchar();
    if(last=='-')ans=-ans;
    return ans;
}
int n;
int a[maxn];
vector<int>save[maxn];
int main()
{
    n=read();
    rep(i,1,n)a[i]=read();
    ll ans=0;
    rep(i,1,n)
    {
        int cur=a[i]%200;

        ans+=save[cur].size();
        save[cur].push_back(a[i]);
    }
    cout<<ans<<endl;
    return 0;
}


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

int main()
{
    long long n, p = 0, a[2500] = {0};
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> p;
        a[p % 200]++;
    }
    long long ans = 0;
    for (int i = 0; i < 200; i++)
    {
        ans += (a[i] * (a[i] - 1)) / 2;
    }
    cout << ans;
}