n = int(eval(input()))

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

cnt = 0

for i in range(n):

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

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

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

            if len(set(tri)) != 3:

                continue

            if 2*max(tri) < sum(tri):

                cnt += 1

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

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

cnt = 0

for i in range(n):

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

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

            if len(set([l[i], l[j], l[k]])) != 3:

                continue

            if l[k] < l[i] + l[j]:

                cnt += 1

print(cnt)
n = int(eval(input()))
l = list(map(int, input().split()))
cnt = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            tri = [l[i], l[j], l[k]]
            if len(set(tri)) != 3:
                continue
            if 2 * max(tri) < sum(tri):
                cnt += 1
print(cnt)

n = int(eval(input()))
l = sorted(list(map(int, input().split())))
cnt = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if len(set([l[i], l[j], l[k]])) != 3:
                continue
            if l[k] < l[i] + l[j]:
                cnt += 1
print(cnt)

-l = list(map(int, input().split())) +l = sorted(list(map(int, input().split()))) -            tri = [l[i], l[j], l[k]] -            if len(set(tri)) != 3: +            if len(set([l[i], l[j], l[k]])) != 3: -            if 2 * max(tri) < sum(tri): +            if l[k] < l[i] + l[j]: