#!/usr/bin/env python3

n = int(eval(input()))

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

cnt = 0

for i in range(n):

    for j in range(i + 1, n):

        for k in range(j + 1, n):

            if max(a[i], a[j], a[k]) * 2 < sum([a[i], a[j], a[k]]):

                if a[i] != a[j] and a[i] != a[k] and a[j] != a[k]:

                    cnt += 1

print(cnt)

#!/usr/bin/env python3

n = int(eval(input()))

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

l.sort()

ans = 0

for i in range(n):

    for j in range(i + 1, n):

        for k in range(j + 1, n):

            if (

                l[i] != l[j]

                and l[j] != l[k]

                and l[i] > l[k] - l[j]

                and l[k] < l[i] + l[j]

            ):

                ans += 1

print(ans)

#!/usr/bin/env python3
n = int(eval(input()))
a = list(map(int, input().split()))
cnt = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if max(a[i], a[j], a[k]) * 2 < sum([a[i], a[j], a[k]]):
                if a[i] != a[j] and a[i] != a[k] and a[j] != a[k]:
                    cnt += 1
print(cnt)

#!/usr/bin/env python3
n = int(eval(input()))
l = list(map(int, input().split()))
l.sort()
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if (
                l[i] != l[j]
                and l[j] != l[k]
                and l[i] > l[k] - l[j]
                and l[k] < l[i] + l[j]
            ):
                ans += 1
print(ans)

-a = list(map(int, input().split())) -cnt = 0 +l = list(map(int, input().split())) +l.sort() +ans = 0 -            if max(a[i], a[j], a[k]) * 2 < sum([a[i], a[j], a[k]]): -                if a[i] != a[j] and a[i] != a[k] and a[j] != a[k]: -                    cnt += 1 -print(cnt) +            if ( +                l[i] != l[j] +                and l[j] != l[k] +                and l[i] > l[k] - l[j] +                and l[k] < l[i] + l[j] +            ): +                ans += 1 +print(ans)