import itertools

N = int(input())
L = list(map(int,(input().split())))
L.sort()
Combi = itertools.combinations(L, 3)
count = 0

for i, j, k in Combi:

    if((i+j)> k and i!=j!=k and  i<j <k ):
        count+=1
print(count) import itertools itertools 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 L.sort() L.sort L sort Combi = itertools.combinations(L, 3) Combi itertools.combinations(L, 3) itertools.combinations itertools combinations L 3 count = 0 count 0 for i, j, k in Combi:

    if((i+j)> k and i!=j!=k and  i<j <k ):
        count+=1 i j k Combi if((i+j)> k and i!=j!=k and  i<j <k ):
        count+=1 (i+j)> k and i!=j!=k and  i<j <k (i+j)> k and i!=j!=k (i+j)> k i+j i j k i!=j!=k i!=j i j k i<j <k i<j i j k count+=1 count 1 print(count) print count count = 0 0 count L = list(map(int,(input().split()))) list(map(int,(input().split()))) L N = int(input()) int(input()) N count+=1 1 count Combi = itertools.combinations(L, 3) itertools.combinations(L, 3) Combi
import itertools

N = int(input())
L = list(map(int,(input().split())))
L.sort()
Combi = itertools.combinations(L, 3)
count = 0

for i, j, k in Combi:

    if((i+j)> k and i!=j!=k and  i<j <k ):
        count+=1
print(count)