N=int(eval(input()))

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

L.sort()



ans=0

for i in range(N-2):

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

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

            a,b,c=L[i],L[j],L[k]

            if a!=b and b!=c and a+b>c:

                ans+=1



print(ans)

N=int(eval(input()))

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

L.sort()



ans=0

for i in range(N-2):

    a=L[i]

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

        b=L[j]

        if a==b:

            continue

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

            c=L[k]

            if b==c:

                continue

            ans+=a+b>c



print(ans)

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

N = int(eval(input()))
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N - 2):
    a = L[i]
    for j in range(i + 1, N - 1):
        b = L[j]
        if a == b:
            continue
        for k in range(j + 1, N):
            c = L[k]
            if b == c:
                continue
            ans += a + b > c
print(ans)

+    a = L[i] +        b = L[j] +        if a == b: +            continue -            a, b, c = L[i], L[j], L[k] -            if a != b and b != c and a + b > c: -                ans += 1 +            c = L[k] +            if b == c: +                continue +            ans += a + b > c