n = int(eval(input()))

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



nums = set([])

for i in range(n):

    for j in range(n):

        for k in range(n):

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

                continue

            else:

                ver = [l[i],l[j],l[k]]

                num = [i,j,k]

                ver.sort()

                num.sort()

                if ver[0] + ver[1] > ver[2]:

                    nums.add(tuple(num))



print((len(nums)))
n = int(eval(input()))

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



nums = set([])

for i in range(n):

    for j in range(i,n):

        for k in range(j,n):

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

                continue

            else:

                ver = [l[i],l[j],l[k]]

                num = [i,j,k]

                ver.sort()

                num.sort()

                if ver[0] + ver[1] > ver[2]:

                    nums.add(tuple(num))



print((len(nums)))

n = int(eval(input()))
l = list(map(int, input().split()))
nums = set([])
for i in range(n):
    for j in range(n):
        for k in range(n):
            if l[i] == l[j] or l[i] == l[k] or l[j] == l[k]:
                continue
            else:
                ver = [l[i], l[j], l[k]]
                num = [i, j, k]
                ver.sort()
                num.sort()
                if ver[0] + ver[1] > ver[2]:
                    nums.add(tuple(num))
print((len(nums)))

n = int(eval(input()))
l = list(map(int, input().split()))
nums = set([])
for i in range(n):
    for j in range(i, n):
        for k in range(j, n):
            if l[i] == l[j] or l[i] == l[k] or l[j] == l[k]:
                continue
            else:
                ver = [l[i], l[j], l[k]]
                num = [i, j, k]
                ver.sort()
                num.sort()
                if ver[0] + ver[1] > ver[2]:
                    nums.add(tuple(num))
print((len(nums)))

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