import std.stdio;
import std.conv;
import std.string;
import std.array;
import std.algorithm;

void main() {
	auto n = readln.chomp.to!int;
	auto a = readln.chomp.split(" ").map!(to!long).array;
	long[long] table;

	foreach (e;a) {
		++table[e];
	}

	table.rehash;

	foreach (e;a) {
		long patterns = 0;
		foreach (key;table.keys) {
			auto value = table[key];
			
			if (key == e) {
				if (value > 2) {
					patterns += (value - 1) * (value - 2) / 2;
				}
			} else {
				patterns += value * (value - 1) / 2;
			}
		}
		writeln(patterns);
	}
	
}
