program main
  implicit none

  integer::n,answer,i,j,k
  real(8),allocatable::L(:)
  real(8)::ans(3)

  read*,n
  allocate(L(n))
  read*,L

answer=0

  do i=1,n
   do j=i+1,n
    do k=j+1,n
    a:  if((L(i) /= L(j)) .and. (L(j) /= L(k)) .and. (L(k) /= L(i))) then
        ans(1)=L(i)
        ans(2)=L(j)
        ans(3)=L(k)

    b:     if((abs(ans(3)-ans(2)) < ans(1)) .and. ((ans(3)+ans(2)) > ans(1)) ) then
             answer=answer+1
           end if b
         
         end if a

     end do
    end do
   end do

  print*,answer
        
end program main


      