n,*l=list(map(int,open(0).read().split()))

print((sum(i!=j!=k!=i and j+k>i and k+i>j and i+j>k for i in l for j in l for k in l)//6))
n,*l=list(map(int,open(0).read().split()))

l.sort()

print((sum(i<j<k and i+j>k for i in l for j in l for k in l)))
n, *l = list(map(int, open(0).read().split()))
print(
    (
        sum(
            i != j != k != i and j + k > i and k + i > j and i + j > k
            for i in l
            for j in l
            for k in l
        )
        // 6
    )
)

n, *l = list(map(int, open(0).read().split()))
l.sort()
print((sum(i < j < k and i + j > k for i in l for j in l for k in l)))

-print( -    ( -        sum( -            i != j != k != i and j + k > i and k + i > j and i + j > k -            for i in l -            for j in l -            for k in l -        ) -        // 6 -    ) -) +l.sort() +print((sum(i < j < k and i + j > k for i in l for j in l for k in l)))