N=int(eval(input()))

c=0

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

for i in range(0,N):

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

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

      if l[i]<l[j]+l[k] and l[j]<l[i]+l[k] and l[k]<l[j]+l[i] and l[k]!=l[j] and l[k]!=l[i] and l[i]!=l[j] :

        c=c+1

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

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

c=0

for i in range(0,n-2):

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

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

            if l[i]!=l[j] and l[k]!=l[j] and l[i]!=l[k] and abs(l[i]-l[j])< l[k] <l[i]+l[j]:

                c+=1

print(c)

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

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

-N = int(eval(input())) +n = int(eval(input())) +l = list(map(int, input().split())) -l = list(map(int, input().split())) -for i in range(0, N): -    for j in range(i + 1, N): -        for k in range(j + 1, N): +for i in range(0, n - 2): +    for j in range(i + 1, n - 1): +        for k in range(j + 1, n): -                l[i] < l[j] + l[k] -                and l[j] < l[i] + l[k] -                and l[k] < l[j] + l[i] +                l[i] != l[j] -                and l[k] != l[i] -                and l[i] != l[j] +                and l[i] != l[k] +                and abs(l[i] - l[j]) < l[k] < l[i] + l[j] -                c = c + 1 +                c += 1