#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> a;
  map<long long, long long> m;
  for (long long i = 0; i < n; i++) {
    long long j;
    cin >> j;
    a.push_back(j);
    if (m.count(j) == 0)
      m.insert(make_pair(j, 1));
    else
      m.at(j)++;
  }
  long long sum = 0;
  map<long long, long long>::iterator iter;
  for (iter = m.begin(); iter != m.end(); iter++)
    sum += iter->second * (iter->second - 1) / 2;
  for (long long i = 0; i < n; i++) cout << sum + 1 - m[a[i]] << ' ';
  return 0;
}
