n = int(eval(input()))

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

ans = 0

for i in range(n-2):

    for j in range(i + 1, n-1):

        for k in range(j + 1, n):

            if len({l[i], l[j], l[k]}) != 3:

                continue

            if l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[j] + l[k] > l[i]:

                ans += 1

print(ans)

from itertools import combinations



n = int(eval(input()))

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

l.sort()

ans = 0



for li, lj, lk in combinations(l, 3):

    if li < lj < lk < li + lj:

        ans += 1

print(ans)

n = int(eval(input()))
l = list(map(int, input().split()))
ans = 0
for i in range(n - 2):
    for j in range(i + 1, n - 1):
        for k in range(j + 1, n):
            if len({l[i], l[j], l[k]}) != 3:
                continue
            if l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[j] + l[k] > l[i]:
                ans += 1
print(ans)

from itertools import combinations

n = int(eval(input()))
l = list(map(int, input().split()))
l.sort()
ans = 0
for li, lj, lk in combinations(l, 3):
    if li < lj < lk < li + lj:
        ans += 1
print(ans)

+from itertools import combinations + +l.sort() -for i in range(n - 2): -    for j in range(i + 1, n - 1): -        for k in range(j + 1, n): -            if len({l[i], l[j], l[k]}) != 3: -                continue -            if l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[j] + l[k] > l[i]: -                ans += 1 +for li, lj, lk in combinations(l, 3): +    if li < lj < lk < li + lj: +        ans += 1