import itertools

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

L.sort(reverse = True)
li = list(itertools.combinations(L, 3))

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

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

L.sort(reverse = True)
li = list(itertools.combinations(L, 3))

ans = 0
for v in li:
    if v[0] != v[1] and v[1] != v[2] and v[0] - v[1] < v[2]:
        ans += 1
print(ans)
