    #include <bits/stdc++.h>
    using namespace std;
    #include <math.h>
    #include <iomanip>
    #include <cstdint>
    #include <string>
    #include <sstream>
    template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
    template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
    #define rep(i,n) for (int i = 0; i < (n); ++i)
    typedef long long ll;
    using P = pair<ll,ll>;
    const int mod=998244353;
    const int INF=1001001001;
    
    template<typename T>
    struct BIT {
      int n;
      vector<T> d;
      BIT(int n=0):n(n),d(n+1) {}
      void add(int i, T x=1) {
        for (i++; i <= n; i += i&-i) {
          d[i] += x;
        }
      }
      T sum(int i) {
        T x = 0;
        for (i++; i; i -= i&-i) {
          x += d[i];
        }
        return x;
      }
      T sum(int l, int r) {
        return sum(r-1) - sum(l-1);
      }
    };

    int main() {
      int N;
      cin>>N;
      vector<int>a(N);
      rep(i,N){cin>>a[i];}
      BIT<int>d(N);
      ll sum=0;
      rep(i,N){
        sum+=d.sum(a[i]+1,N);
        d.add(a[i]);
      }
      rep(i,N){
        cout<<sum<<endl;
        sum=-a[i]+N-1-a[i]+sum;
      }
  
      return 0;
    }

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__);fflush(stderr);
#else
	#define eprintf(...) 42
#endif

using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
int main()
{

    long long n;
    cin>>n;
    long long int a[n];
    long long int c[200];
    for (int i=0;i<200;i++)
        c[i]=0;
    for (int i=0;i<n;i++)
    {
          cin>>a[i];
          int m=a[i]%200;
             c[m]++;
    }
   long long int count=0;
    for (int i=0;i<200;i++)
    {
     count=count+(c[i]*(c[i]-1)/2);

    }
    cout<<count<<endl;









    return 0;
}
