import itertools as it





N = int(eval(input())) - 1

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

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

    maximum = max(listed)

    listed.remove(maximum)

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

        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())) - 1
s = list(map(int, input().split()))
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
    maximum = max(listed)
    listed.remove(maximum)
    if (listed[0] + listed[1]) > maximum:
        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)

-N = int(eval(input())) - 1 +N = int(eval(input())) +s.sort() -    maximum = max(listed) -    listed.remove(maximum) -    if (listed[0] + listed[1]) > maximum: +    if (listed[0] + listed[1]) > listed[2]: