from itertools import combinations



N = int(eval(input()))

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



def f(a, b, c):

    return len(set([a, b, c])) == 3 and a+b>c and b+c>a and c+a>b



ans = 0

for a, b, c in combinations(L, 3):

    if f(a, b, c):

        ans += 1

print(ans)
from collections import Counter

from itertools import combinations



N = int(eval(input()))

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

ans = 0

for a, b, c in combinations(list(L.keys()), 3):

    if a+b>c and b+c>a and c+a>b:

        ans += L[a]*L[b]*L[c]

print(ans)
from itertools import combinations

N = int(eval(input()))
L = list(map(int, input().split()))


def f(a, b, c):
    return len(set([a, b, c])) == 3 and a + b > c and b + c > a and c + a > b


ans = 0
for a, b, c in combinations(L, 3):
    if f(a, b, c):
        ans += 1
print(ans)

from collections import Counter
from itertools import combinations

N = int(eval(input()))
L = Counter(list(map(int, input().split())))
ans = 0
for a, b, c in combinations(list(L.keys()), 3):
    if a + b > c and b + c > a and c + a > b:
        ans += L[a] * L[b] * L[c]
print(ans)

+from collections import Counter -L = list(map(int, input().split())) - - -def f(a, b, c): -    return len(set([a, b, c])) == 3 and a + b > c and b + c > a and c + a > b - - +L = Counter(list(map(int, input().split()))) -for a, b, c in combinations(L, 3): -    if f(a, b, c): -        ans += 1 +for a, b, c in combinations(list(L.keys()), 3): +    if a + b > c and b + c > a and c + a > b: +        ans += L[a] * L[b] * L[c]