N = int(eval(input()))

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

cnt = 0



for i in range(N-2):

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

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

            if L[i]!=L[j] and L[j]!=L[k] and L[k]!=L[i]:

                if L[i] < L[j] + L[k] and L[j] < L[k] + L[i] and L[k] < L[i] + L[j]:

                    cnt += 1

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

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



cnt = 0



# ３つの相異なる数字（i, j, k）の組み合わせを調べること

for i in range(n):

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

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

            a = l[i]

            b = l[j]

            c = l[k]

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

                continue

            else:

                if a<b+c and b<c+a and c<a+b:

                    cnt+=1

print(cnt)
N = int(eval(input()))
L = list(map(int, input().split()))
cnt = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        for k in range(j + 1, N):
            if L[i] != L[j] and L[j] != L[k] and L[k] != L[i]:
                if L[i] < L[j] + L[k] and L[j] < L[k] + L[i] and L[k] < L[i] + L[j]:
                    cnt += 1
print(cnt)

n = int(eval(input()))
l = list(map(int, input().split()))
cnt = 0
# ３つの相異なる数字（i, j, k）の組み合わせを調べること
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            a = l[i]
            b = l[j]
            c = l[k]
            if a == b or b == c or c == a:
                continue
            else:
                if a < b + c and b < c + a and c < a + b:
                    cnt += 1
print(cnt)

-N = int(eval(input())) -L = list(map(int, input().split())) +n = int(eval(input())) +l = list(map(int, input().split())) -for i in range(N - 2): -    for j in range(i + 1, N - 1): -        for k in range(j + 1, N): -            if L[i] != L[j] and L[j] != L[k] and L[k] != L[i]: -                if L[i] < L[j] + L[k] and L[j] < L[k] + L[i] and L[k] < L[i] + L[j]: +# ３つの相異なる数字（i, j, k）の組み合わせを調べること +for i in range(n): +    for j in range(i + 1, n): +        for k in range(j + 1, n): +            a = l[i] +            b = l[j] +            c = l[k] +            if a == b or b == c or c == a: +                continue +            else: +                if a < b + c and b < c + a and c < a + b: