import itertools
def II(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
ans=0
N=II()
L=LI()
c = itertools.combinations(L, 3)
for v in itertools.combinations(L, 3):
    v=list(v)
    v.sort()
    if v[0]==v[1] or v[1]==v[2]:
      continue
    if v[0]+v[1]>v[2]:
      ans+=1
print(ans) import itertools itertools def II(): return int(input()) II def MI(): return map(int, input().split()) MI def LI(): return list(map(int, input().split())) LI ans=0 ans 0 N=II() N II() II L=LI() L LI() LI c = itertools.combinations(L, 3) c itertools.combinations(L, 3) itertools.combinations itertools combinations L 3 for v in itertools.combinations(L, 3):
    v=list(v)
    v.sort()
    if v[0]==v[1] or v[1]==v[2]:
      continue
    if v[0]+v[1]>v[2]:
      ans+=1 v itertools.combinations(L, 3) itertools.combinations itertools combinations L 3 v=list(v) v list(v) list v v.sort() v.sort v sort if v[0]==v[1] or v[1]==v[2]:
      continue
     v[0]==v[1] or v[1]==v[2] v[0]==v[1] v[0] v 0 v[1] v 1 v[1]==v[2] v[1] v 1 v[2] v 2 continue if v[0]+v[1]>v[2]:
      ans+=1 v[0]+v[1]>v[2] v[0]+v[1] v[0] v 0 v[1] v 1 v[2] v 2 ans+=1 ans 1 print(ans) print ans N=II() II() N L=LI() LI() L c = itertools.combinations(L, 3) itertools.combinations(L, 3) c ans+=1 1 ans def MI(): return map(int, input().split()) def MI(): return map(int, input().split()) MI ans=0 0 ans v=list(v) list(v) v def LI(): return list(map(int, input().split())) def LI(): return list(map(int, input().split())) LI def II(): return int(input()) def II(): return int(input()) II
import itertools
def II(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
ans=0
N=II()
L=LI()
c = itertools.combinations(L, 3)
for v in itertools.combinations(L, 3):
    v=list(v)
    v.sort()
    if v[0]==v[1] or v[1]==v[2]:
      continue
    if v[0]+v[1]>v[2]:
      ans+=1
print(ans)