import itertools

n = int(input())
L = list(map(int, input().split()))

comb = itertools.combinations(L, 3)

ans = 0

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

n = int(input())
L = list(map(int, input().split()))

comb = itertools.combinations(L, 3)

ans = 0

for i in comb:
    i = list(i)
    i.sort()
    
    if i[0] + i[1] > i[2] and (i[0] != i[1] and i[1] != i[2] and i[2] != i[0]):
        ans += 1
    
print(ans)