n = int(eval(input()))



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

x.sort()



con = 0



for p in range(n):

    for q in range(p+1,n):

        for r in range(q+1,n):

            if x[p] != x[q] and x[q] != x[r] and x[r] < (x[p] + x[q]) and x[q] < (x[p] + x[r]) and (x[r]-x[p]) < x[q] and (x[r]-x[q]) < x[p] and (x[q]-x[p]) < x[r]:

                con += 1

                

print(con);
n = int(eval(input()))



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

x.sort()



con = 0



for p in range(n):

    for q in range(p+1,n):

        for r in range(q+1,n):

            if x[p] != x[q] and x[q] != x[r] and x[r] < (x[p] + x[q]):

                con += 1

                

print(con);

n = int(eval(input()))
x = list(map(int, input().split()))
x.sort()
con = 0
for p in range(n):
    for q in range(p + 1, n):
        for r in range(q + 1, n):
            if (
                x[p] != x[q]
                and x[q] != x[r]
                and x[r] < (x[p] + x[q])
                and x[q] < (x[p] + x[r])
                and (x[r] - x[p]) < x[q]
                and (x[r] - x[q]) < x[p]
                and (x[q] - x[p]) < x[r]
            ):
                con += 1
print(con)

n = int(eval(input()))
x = list(map(int, input().split()))
x.sort()
con = 0
for p in range(n):
    for q in range(p + 1, n):
        for r in range(q + 1, n):
            if x[p] != x[q] and x[q] != x[r] and x[r] < (x[p] + x[q]):
                con += 1
print(con)

-            if ( -                x[p] != x[q] -                and x[q] != x[r] -                and x[r] < (x[p] + x[q]) -                and x[q] < (x[p] + x[r]) -                and (x[r] - x[p]) < x[q] -                and (x[r] - x[q]) < x[p] -                and (x[q] - x[p]) < x[r] -            ): +            if x[p] != x[q] and x[q] != x[r] and x[r] < (x[p] + x[q]):