program atcoder322_D
  integer,dimension(200000) :: A,B
  read(5,*)N
  read(5,*)A(1:N)
  do I=1,N-1
     do J=I+1,N
        if(A(J)==A(I)) B(I)=B(I)+1
     end do
  end do
 do K=1,N   
     write(6,*)sum(B)-B(K)
 end do
end program atcoder322_D