#include <bits/stdc++.h>
 
int cnt[200001];
 
using namespace std;
 
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int &p : a) cin >> p;
  for (int p : a) ++cnt[p];
  long long ans = 0;
  for (int i = 1; i <= 200000; ++i) {
    ans += 1LL * cnt[i] * (cnt[i] - 1) / 2;
  }
  for (int p : a) {
  	cout << ans - cnt[p] + 1 << '\n';
  }
  return 0;
}