import itertools
 
N=int(input())
L=list(map(int,input().split()))

count=0

if len(L)<3:
    Lis=[]
else:
    Lis=list(itertools.combinations(L,3))
 
numb=len(Lis)

for i in range(numb):
    if len(L)<3:
        break
 
    if Lis[i][0]==Lis[i][1] or Lis[i][0]==Lis[i][2] or Lis[i][1]==Lis[i][2]:
        pass
    else:
        bpc=Lis[i][1]+Lis[i][2]
        bmc=abs(Lis[i][1]-Lis[i][2])
        if bmc<Lis[i][0] and Lis[i][0]<bpc:
            #if Lis[i][0]<bpc:
            count+=1
 
print(count) import itertools itertools N=int(input()) N int(input()) int input() input L=list(map(int,input().split())) L list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split count=0 count 0 if len(L)<3:
    Lis=[]
else:
    Lis=list(itertools.combinations(L,3))
  len(L)<3 len(L) len L 3 Lis=[] Lis [] Lis=list(itertools.combinations(L,3)) Lis list(itertools.combinations(L,3)) list itertools.combinations(L,3) itertools.combinations itertools combinations L 3 numb=len(Lis) numb len(Lis) len Lis for i in range(numb):
    if len(L)<3:
        break
 
    if Lis[i][0]==Lis[i][1] or Lis[i][0]==Lis[i][2] or Lis[i][1]==Lis[i][2]:
        pass
    else:
        bpc=Lis[i][1]+Lis[i][2]
        bmc=abs(Lis[i][1]-Lis[i][2])
        if bmc<Lis[i][0] and Lis[i][0]<bpc:
            #if Lis[i][0]<bpc:
            count+=1
  i range(numb) range numb if len(L)<3:
        break
 
     len(L)<3 len(L) len L 3 break if Lis[i][0]==Lis[i][1] or Lis[i][0]==Lis[i][2] or Lis[i][1]==Lis[i][2]:
        pass
    else:
        bpc=Lis[i][1]+Lis[i][2]
        bmc=abs(Lis[i][1]-Lis[i][2])
        if bmc<Lis[i][0] and Lis[i][0]<bpc:
            #if Lis[i][0]<bpc:
            count+=1
  Lis[i][0]==Lis[i][1] or Lis[i][0]==Lis[i][2] or Lis[i][1]==Lis[i][2] Lis[i][0]==Lis[i][1] or Lis[i][0]==Lis[i][2] Lis[i][0]==Lis[i][1] Lis[i][0] [i] Lis i 0 Lis[i][1] [i] Lis i 1 Lis[i][0]==Lis[i][2] Lis[i][0] [i] Lis i 0 Lis[i][2] [i] Lis i 2 Lis[i][1]==Lis[i][2] Lis[i][1] [i] Lis i 1 Lis[i][2] [i] Lis i 2 bpc=Lis[i][1]+Lis[i][2] bpc Lis[i][1]+Lis[i][2] Lis[i][1] [i] Lis i 1 Lis[i][2] [i] Lis i 2 bmc=abs(Lis[i][1]-Lis[i][2]) bmc abs(Lis[i][1]-Lis[i][2]) abs Lis[i][1]-Lis[i][2] Lis[i][1] [i] Lis i 1 Lis[i][2] [i] Lis i 2 if bmc<Lis[i][0] and Lis[i][0]<bpc:
            #if Lis[i][0]<bpc:
            count+=1
  bmc<Lis[i][0] and Lis[i][0]<bpc bmc<Lis[i][0] bmc Lis[i][0] [i] Lis i 0 Lis[i][0]<bpc Lis[i][0] [i] Lis i 0 bpc count+=1 count 1 print(count) print count Lis=[] [] Lis bmc=abs(Lis[i][1]-Lis[i][2]) abs(Lis[i][1]-Lis[i][2]) bmc N=int(input()) int(input()) N count=0 0 count bpc=Lis[i][1]+Lis[i][2] Lis[i][1]+Lis[i][2] bpc count+=1 1 count Lis=list(itertools.combinations(L,3)) list(itertools.combinations(L,3)) Lis L=list(map(int,input().split())) list(map(int,input().split())) L numb=len(Lis) len(Lis) numb
import itertools
 
N=int(input())
L=list(map(int,input().split()))

count=0

if len(L)<3:
    Lis=[]
else:
    Lis=list(itertools.combinations(L,3))
 
numb=len(Lis)

for i in range(numb):
    if len(L)<3:
        break
 
    if Lis[i][0]==Lis[i][1] or Lis[i][0]==Lis[i][2] or Lis[i][1]==Lis[i][2]:
        pass
    else:
        bpc=Lis[i][1]+Lis[i][2]
        bmc=abs(Lis[i][1]-Lis[i][2])
        if bmc<Lis[i][0] and Lis[i][0]<bpc:
            #if Lis[i][0]<bpc:
            count+=1
 
print(count)