from itertools import combinations

n = int(eval(input()))

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

ans = 0

for x in combinations(L,3):

    a,b,c = list(map(int,x))

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

        continue

    ans += (2*max(a,b,c) < a+b+c)

print(ans)
from itertools import combinations

n = int(eval(input()))

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

ans = 0

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

    ans += (2*max(a,b,c) < a+b+c)*(a != b and b != c and c != a)

print(ans)
from itertools import combinations

n = int(eval(input()))
L = list(map(int, input().split()))
ans = 0
for x in combinations(L, 3):
    a, b, c = list(map(int, x))
    if a == b or b == c or c == a:
        continue
    ans += 2 * max(a, b, c) < a + b + c
print(ans)

from itertools import combinations

n = int(eval(input()))
L = list(map(int, input().split()))
ans = 0
for a, b, c in combinations(L, 3):
    ans += (2 * max(a, b, c) < a + b + c) * (a != b and b != c and c != a)
print(ans)

-for x in combinations(L, 3): -    a, b, c = list(map(int, x)) -    if a == b or b == c or c == a: -        continue -    ans += 2 * max(a, b, c) < a + b + c +for a, b, c in combinations(L, 3): +    ans += (2 * max(a, b, c) < a + b + c) * (a != b and b != c and c != a)