Main=(t=>{"use strict";t=t.split("\n")[1].split(" ");let o={};for(const e of t)o[e]=(o[e]||0)+1;for(let e=0;e<t.length;e++){const l=t[e];let s=0;for(const t of Object.keys(o)){let e=t==l?o[t]-1:o[t];s+=e*(e-1)/2}console.log(s)}}); Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());