from itertools import combinations

n = int(eval(input()))

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



ans = 0

for subset in combinations(L, 3):

    subset = sorted(subset)

    if len(set(subset)) != 3:

        continue

    a, b, c = subset

    if c < a+b:

        ans += 1

print(ans)

n = int(eval(input()))

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

ans = 0

for i in range(n):

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

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

            a, b, c = sorted([L[i], L[j], L[k]])

            if a == b or b == c or c == a:

                continue

            if c < a+b:

                ans += 1

print(ans)

from itertools import combinations

n = int(eval(input()))
L = list(map(int, input().split()))
ans = 0
for subset in combinations(L, 3):
    subset = sorted(subset)
    if len(set(subset)) != 3:
        continue
    a, b, c = subset
    if c < a + b:
        ans += 1
print(ans)

n = int(eval(input()))
L = list(map(int, input().split()))
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            a, b, c = sorted([L[i], L[j], L[k]])
            if a == b or b == c or c == a:
                continue
            if c < a + b:
                ans += 1
print(ans)

-from itertools import combinations - -for subset in combinations(L, 3): -    subset = sorted(subset) -    if len(set(subset)) != 3: -        continue -    a, b, c = subset -    if c < a + b: -        ans += 1 +for i in range(n): +    for j in range(i + 1, n): +        for k in range(j + 1, n): +            a, b, c = sorted([L[i], L[j], L[k]]) +            if a == b or b == c or c == a: +                continue +            if c < a + b: +                ans += 1