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

ans = 0
if N<=2:
  print(0)
  exit()
for i1 in range(N-2):
  l1 = L[i1]
  for i2 in range(i1+1,N-1):
    l2 = L[i2]
    for i3 in range(i2+1,N):
      l3 = L[i3]
      if l1==l2 or l2==l3 or l3==l1: continue
      tmp = sorted([l1,l2,l3])
      if tmp[0]+tmp[1]>tmp[2]:
        ans += 1
print(ans) 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 ans = 0 ans 0 if N<=2:
  print(0)
  exit() N<=2 N 2 print(0) print 0 exit() exit for i1 in range(N-2):
  l1 = L[i1]
  for i2 in range(i1+1,N-1):
    l2 = L[i2]
    for i3 in range(i2+1,N):
      l3 = L[i3]
      if l1==l2 or l2==l3 or l3==l1: continue
      tmp = sorted([l1,l2,l3])
      if tmp[0]+tmp[1]>tmp[2]:
        ans += 1 i1 range(N-2) range N-2 N 2 l1 = L[i1] l1 L[i1] L i1 for i2 in range(i1+1,N-1):
    l2 = L[i2]
    for i3 in range(i2+1,N):
      l3 = L[i3]
      if l1==l2 or l2==l3 or l3==l1: continue
      tmp = sorted([l1,l2,l3])
      if tmp[0]+tmp[1]>tmp[2]:
        ans += 1 i2 range(i1+1,N-1) range i1+1 i1 1 N-1 N 1 l2 = L[i2] l2 L[i2] L i2 for i3 in range(i2+1,N):
      l3 = L[i3]
      if l1==l2 or l2==l3 or l3==l1: continue
      tmp = sorted([l1,l2,l3])
      if tmp[0]+tmp[1]>tmp[2]:
        ans += 1 i3 range(i2+1,N) range i2+1 i2 1 N l3 = L[i3] l3 L[i3] L i3 if l1==l2 or l2==l3 or l3==l1: continue
       l1==l2 or l2==l3 or l3==l1 l1==l2 or l2==l3 l1==l2 l1 l2 l2==l3 l2 l3 l3==l1 l3 l1 tmp = sorted([l1,l2,l3]) tmp sorted([l1,l2,l3]) sorted [l1,l2,l3] l1 l2 l3 if tmp[0]+tmp[1]>tmp[2]:
        ans += 1 tmp[0]+tmp[1]>tmp[2] tmp[0]+tmp[1] tmp[0] tmp 0 tmp[1] tmp 1 tmp[2] tmp 2 ans += 1 ans 1 print(ans) print ans ans = 0 0 ans l3 = L[i3] L[i3] l3 ans += 1 1 ans l1 = L[i1] L[i1] l1 l2 = L[i2] L[i2] l2 L = list(map(int,input().split())) list(map(int,input().split())) L tmp = sorted([l1,l2,l3]) sorted([l1,l2,l3]) tmp N=int(input()) int(input()) N
N=int(input())
L = list(map(int,input().split()))

ans = 0
if N<=2:
  print(0)
  exit()
for i1 in range(N-2):
  l1 = L[i1]
  for i2 in range(i1+1,N-1):
    l2 = L[i2]
    for i3 in range(i2+1,N):
      l3 = L[i3]
      if l1==l2 or l2==l3 or l3==l1: continue
      tmp = sorted([l1,l2,l3])
      if tmp[0]+tmp[1]>tmp[2]:
        ans += 1
print(ans)