# coding: utf-8
# Your code here!
n=int(input())
s=list(map(int,input().split()))
s.sort()
ans=0
for i in range(n):
  for j in range(n):
    if s[i]<s[j]:
      for k in range(n):
        if s[j]<s[k] and s[i]+s[j]>s[k]:
          ans+=1
print(ans)
 n=int(input()) n int(input()) int input() input s=list(map(int,input().split())) s list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split s.sort() s.sort s sort ans=0 ans 0 for i in range(n):
  for j in range(n):
    if s[i]<s[j]:
      for k in range(n):
        if s[j]<s[k] and s[i]+s[j]>s[k]:
          ans+=1 i range(n) range n for j in range(n):
    if s[i]<s[j]:
      for k in range(n):
        if s[j]<s[k] and s[i]+s[j]>s[k]:
          ans+=1 j range(n) range n if s[i]<s[j]:
      for k in range(n):
        if s[j]<s[k] and s[i]+s[j]>s[k]:
          ans+=1 s[i]<s[j] s[i] s i s[j] s j for k in range(n):
        if s[j]<s[k] and s[i]+s[j]>s[k]:
          ans+=1 k range(n) range n if s[j]<s[k] and s[i]+s[j]>s[k]:
          ans+=1 s[j]<s[k] and s[i]+s[j]>s[k] s[j]<s[k] s[j] s j s[k] s k s[i]+s[j]>s[k] s[i]+s[j] s[i] s i s[j] s j s[k] s k ans+=1 ans 1 print(ans) print ans ans=0 0 ans ans+=1 1 ans s=list(map(int,input().split())) list(map(int,input().split())) s n=int(input()) int(input()) n
# coding: utf-8
# Your code here!
n=int(input())
s=list(map(int,input().split()))
s.sort()
ans=0
for i in range(n):
  for j in range(n):
    if s[i]<s[j]:
      for k in range(n):
        if s[j]<s[k] and s[i]+s[j]>s[k]:
          ans+=1
print(ans)

