import itertools

N = int(input())
A = list(map(int,input().split()))
A.sort()

Acomb = list(itertools.combinations(A, 3))

ans = 0
for tri in Acomb: 
  if tri[0] < tri[1] and tri[1] < tri[2] and tri[0] + tri[1] > tri[2]:
    ans += 1
print(ans) import itertools itertools N = int(input()) N int(input()) int input() input A = list(map(int,input().split())) A list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split A.sort() A.sort A sort Acomb = list(itertools.combinations(A, 3)) Acomb list(itertools.combinations(A, 3)) list itertools.combinations(A, 3) itertools.combinations itertools combinations A 3 ans = 0 ans 0 for tri in Acomb: 
  if tri[0] < tri[1] and tri[1] < tri[2] and tri[0] + tri[1] > tri[2]:
    ans += 1 tri Acomb if tri[0] < tri[1] and tri[1] < tri[2] and tri[0] + tri[1] > tri[2]:
    ans += 1 tri[0] < tri[1] and tri[1] < tri[2] and tri[0] + tri[1] > tri[2] tri[0] < tri[1] and tri[1] < tri[2] tri[0] < tri[1] tri[0] tri 0 tri[1] tri 1 tri[1] < tri[2] tri[1] tri 1 tri[2] tri 2 tri[0] + tri[1] > tri[2] tri[0] + tri[1] tri[0] tri 0 tri[1] tri 1 tri[2] tri 2 ans += 1 ans 1 print(ans) print ans ans += 1 1 ans ans = 0 0 ans N = int(input()) int(input()) N A = list(map(int,input().split())) list(map(int,input().split())) A Acomb = list(itertools.combinations(A, 3)) list(itertools.combinations(A, 3)) Acomb
import itertools

N = int(input())
A = list(map(int,input().split()))
A.sort()

Acomb = list(itertools.combinations(A, 3))

ans = 0
for tri in Acomb: 
  if tri[0] < tri[1] and tri[1] < tri[2] and tri[0] + tri[1] > tri[2]:
    ans += 1
print(ans)