import itertools
 
N = int(input())
L = list(map(int,(input().split())))
L.sort()
Combi = list(itertools.combinations(L, 3))
count = 0
 
for i in Combi:
    a = int(i[0])
    b = int(i[1])
    c = int(i[2])
    if((a+b)> c and a!=b != c and  a<b <c ):
        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 = list(itertools.combinations(L, 3)) Combi list(itertools.combinations(L, 3)) list itertools.combinations(L, 3) itertools.combinations itertools combinations L 3 count = 0 count 0 for i in Combi:
    a = int(i[0])
    b = int(i[1])
    c = int(i[2])
    if((a+b)> c and a!=b != c and  a<b <c ):
        count+=1
  i Combi a = int(i[0]) a int(i[0]) int i[0] i 0 b = int(i[1]) b int(i[1]) int i[1] i 1 c = int(i[2]) c int(i[2]) int i[2] i 2 if((a+b)> c and a!=b != c and  a<b <c ):
        count+=1
  (a+b)> c and a!=b != c and  a<b <c (a+b)> c and a!=b != c (a+b)> c a+b a b c a!=b != c a!=b a b c a<b <c a<b a b c count+=1 count 1 print(count) print count N = int(input()) int(input()) N Combi = list(itertools.combinations(L, 3)) list(itertools.combinations(L, 3)) Combi b = int(i[1]) int(i[1]) b L = list(map(int,(input().split()))) list(map(int,(input().split()))) L a = int(i[0]) int(i[0]) a c = int(i[2]) int(i[2]) c count+=1 1 count count = 0 0 count
import itertools
 
N = int(input())
L = list(map(int,(input().split())))
L.sort()
Combi = list(itertools.combinations(L, 3))
count = 0
 
for i in Combi:
    a = int(i[0])
    b = int(i[1])
    c = int(i[2])
    if((a+b)> c and a!=b != c and  a<b <c ):
        count+=1
 
print(count)