n = int(eval(input()))

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

ans = 0



if n<3:

    print((0))

    exit()



for i in range(n):

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

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

            if a[i]==a[j] or a[j]==a[k] or a[k]==a[i]:

                continue

            if a[i]+a[j]<=a[k] or a[j]+a[k]<=a[i] or a[k]+a[i]<=a[j]:

                continue

            ans += 1



print(ans)
n = int(eval(input()))

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



a.sort()

ans = 0



for i in range(n):

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

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

            if a[i] != a[j] and a[j] != a[k] and a[k] != a[i] and a[i]+a[j] > a[k]:

                ans += 1

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

n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if a[i] != a[j] and a[j] != a[k] and a[k] != a[i] and a[i] + a[j] > a[k]:
                ans += 1
print(ans)

+a.sort() -if n < 3: -    print((0)) -    exit() -            if a[i] == a[j] or a[j] == a[k] or a[k] == a[i]: -                continue -            if a[i] + a[j] <= a[k] or a[j] + a[k] <= a[i] or a[k] + a[i] <= a[j]: -                continue -            ans += 1 +            if a[i] != a[j] and a[j] != a[k] and a[k] != a[i] and a[i] + a[j] > a[k]: +                ans += 1