import itertools

n = int(eval(input()))

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

count = 0

ind_list = list(itertools.combinations(list(range(0,n)), 3))



for ind in ind_list:

    if (l[ind[0]]+l[ind[1]])>l[ind[2]] and (l[ind[1]]+l[ind[2]])>l[ind[0]] and (l[ind[2]]+l[ind[0]])>l[ind[1]]:

        if l[ind[0]]!=l[ind[1]] and l[ind[0]]!=l[ind[2]] and l[ind[1]]!=l[ind[2]]:

            count += 1



print(count)
import itertools

n = int(eval(input()))

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

count = 0

c_list = list(itertools.combinations(l, 3))



for c in c_list:

    if (c[0]+c[1])>c[2] and (c[1]+c[2])>c[0] and (c[2]+c[0])>c[1]:

        if len(set(c)) == 3:

            count += 1



print(count)
import itertools

n = int(eval(input()))
l = list(map(int, input().split()))
count = 0
ind_list = list(itertools.combinations(list(range(0, n)), 3))
for ind in ind_list:
    if (
        (l[ind[0]] + l[ind[1]]) > l[ind[2]]
        and (l[ind[1]] + l[ind[2]]) > l[ind[0]]
        and (l[ind[2]] + l[ind[0]]) > l[ind[1]]
    ):
        if l[ind[0]] != l[ind[1]] and l[ind[0]] != l[ind[2]] and l[ind[1]] != l[ind[2]]:
            count += 1
print(count)

import itertools

n = int(eval(input()))
l = list(map(int, input().split()))
count = 0
c_list = list(itertools.combinations(l, 3))
for c in c_list:
    if (c[0] + c[1]) > c[2] and (c[1] + c[2]) > c[0] and (c[2] + c[0]) > c[1]:
        if len(set(c)) == 3:
            count += 1
print(count)

-ind_list = list(itertools.combinations(list(range(0, n)), 3)) -for ind in ind_list: -    if ( -        (l[ind[0]] + l[ind[1]]) > l[ind[2]] -        and (l[ind[1]] + l[ind[2]]) > l[ind[0]] -        and (l[ind[2]] + l[ind[0]]) > l[ind[1]] -    ): -        if l[ind[0]] != l[ind[1]] and l[ind[0]] != l[ind[2]] and l[ind[1]] != l[ind[2]]: +c_list = list(itertools.combinations(l, 3)) +for c in c_list: +    if (c[0] + c[1]) > c[2] and (c[1] + c[2]) > c[0] and (c[2] + c[0]) > c[1]: +        if len(set(c)) == 3: