from itertools import *
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=0
for i,j,k in combinations(a,3):
    if i<j<k and i+j>k:
      ans+=1
print(ans) from itertools import * 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 ans=0 ans 0 for i,j,k in combinations(a,3):
    if i<j<k and i+j>k:
      ans+=1 i j k combinations(a,3) combinations a 3 if i<j<k and i+j>k:
      ans+=1 i<j<k and i+j>k i<j<k i<j i j k i+j>k i+j i j k ans+=1 ans 1 print(ans) print ans a=list(map(int,input().split())) list(map(int,input().split())) a n=int(input()) int(input()) n ans+=1 1 ans ans=0 0 ans
from itertools import *
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=0
for i,j,k in combinations(a,3):
    if i<j<k and i+j>k:
      ans+=1
print(ans)