#include<bits/stdc++.h>

using namespace std;
typedef long long LL;
int frek[212121];

int main() {
	int N;
	scanf("%d", &N);
	int arr[N + 5];
	LL awal = 0;
	for (int i = 0; i < N; i++) {
		scanf("%d", &arr[i]);
		awal += frek[arr[i]];
		frek[arr[i]]++;
	}
	for (int i = 0; i < N; i++) {
		cout << awal - frek[arr[i]] + 1 << "\n";
	}
}