n=int(input())
l=[int(i) for i in input().split()]
 
l.sort()
 
def func(one,two,three):
  if len({one,two,three})==3 and one+two>three:
    return True
  return False
 
ans=0
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      one=l[i]
      two=l[j]
      three=l[k]
      if func(one,two,three):
        ans+=1
        
print(ans) n=int(input()) n int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i l=[int(i) for i in input().split()] l [int(i) for i in input().split()] l.sort() l.sort l sort def func(one,two,three):
  if len({one,two,three})==3 and one+two>three:
    return True
  return False
  func if len({one,two,three})==3 and one+two>three:
    return True
   len({one,two,three})==3 and one+two>three len({one,two,three})==3 len({one,two,three}) len {one,two,three} 3 one+two>three one+two one two three return True True return False False one one two two three three ans=0 ans 0 for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      one=l[i]
      two=l[j]
      three=l[k]
      if func(one,two,three):
        ans+=1
         i range(n-2) range n-2 n 2 for j in range(i+1,n-1):
    for k in range(j+1,n):
      one=l[i]
      two=l[j]
      three=l[k]
      if func(one,two,three):
        ans+=1
         j range(i+1,n-1) range i+1 i 1 n-1 n 1 for k in range(j+1,n):
      one=l[i]
      two=l[j]
      three=l[k]
      if func(one,two,three):
        ans+=1
         k range(j+1,n) range j+1 j 1 n one=l[i] one l[i] l i two=l[j] two l[j] l j three=l[k] three l[k] l k if func(one,two,three):
        ans+=1
         func(one,two,three) func one two three ans+=1 ans 1 print(ans) print ans l=[int(i) for i in input().split()] [int(i) for i in input().split()] l two=l[j] l[j] two one=l[i] l[i] one def func(one,two,three):
  if len({one,two,three})==3 and one+two>three:
    return True
  return False
  def func(one,two,three):
  if len({one,two,three})==3 and one+two>three:
    return True
  return False
  func three=l[k] l[k] three ans=0 0 ans n=int(input()) int(input()) n ans+=1 1 ans
n=int(input())
l=[int(i) for i in input().split()]
 
l.sort()
 
def func(one,two,three):
  if len({one,two,three})==3 and one+two>three:
    return True
  return False
 
ans=0
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      one=l[i]
      two=l[j]
      three=l[k]
      if func(one,two,three):
        ans+=1
        
print(ans)