Main=(e=>{const t=(e=e.split("\n"))[1].split(" ").map(e=>+e),n=t.map((e,n)=>t.filter((e,t)=>n!==t)).map(e=>{let t={};return e.forEach(e=>{t[e]=+(t[e]||0)+1}),Object.entries(t).filter(e=>e[1]>1).map(e=>e[1]*(e[1]-1)/2).reduce((e,t)=>e+t,0)});console.log(n.join("\n"))}); Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());