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