import itertools as it





N = int(eval(input()))

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

s.sort()

count = 0





c = it.combinations(s, 3)



for i in c:

    listed = list(i)

    if listed[0] == listed[1] or listed[1] == listed[2] or listed[2] == listed[0]:

        continue

    if (listed[0] + listed[1]) > listed[2]:

        count += 1



print(count)
import itertools as it





N = int(eval(input()))

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

s.sort()

count = 0





c = it.combinations(s, 3)



for i in c:

    if i[0] == i[1] or i[1] == i[2] or i[2] == i[0]:

        continue

    elif (i[0] + i[1]) > i[2]:

        count += 1



print(count)
import itertools as it

N = int(eval(input()))
s = list(map(int, input().split()))
s.sort()
count = 0
c = it.combinations(s, 3)
for i in c:
    listed = list(i)
    if listed[0] == listed[1] or listed[1] == listed[2] or listed[2] == listed[0]:
        continue
    if (listed[0] + listed[1]) > listed[2]:
        count += 1
print(count)

import itertools as it

N = int(eval(input()))
s = list(map(int, input().split()))
s.sort()
count = 0
c = it.combinations(s, 3)
for i in c:
    if i[0] == i[1] or i[1] == i[2] or i[2] == i[0]:
        continue
    elif (i[0] + i[1]) > i[2]:
        count += 1
print(count)

-    listed = list(i) -    if listed[0] == listed[1] or listed[1] == listed[2] or listed[2] == listed[0]: +    if i[0] == i[1] or i[1] == i[2] or i[2] == i[0]: -    if (listed[0] + listed[1]) > listed[2]: +    elif (i[0] + i[1]) > i[2]: