import itertools

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

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

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

c = list(itertools.combinations(l, 3))
ans = 0
for i in c:
    j = sorted(i)
    if j[0] != j[1] != j[2] != j[0]:
        if j[2] < j[0]+j[1]:
            ans += 1
print(ans)
