from itertools import combinations

N = int(input())
L = list(map(int, input().split()))

ans = 0

for a, b, c in combinations(L, 3):
    if a == b or b ==c or a == c:
        continue
    if a + b + c - max(a, b, c) > max(a, b, c):
        ans += 1

print(ans) from itertools import combinations N = int(input()) N int(input()) int input() input L = list(map(int, input().split())) L list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = 0 ans 0 for a, b, c in combinations(L, 3):
    if a == b or b ==c or a == c:
        continue
    if a + b + c - max(a, b, c) > max(a, b, c):
        ans += 1 a b c combinations(L, 3) combinations L 3 if a == b or b ==c or a == c:
        continue
     a == b or b ==c or a == c a == b or b ==c a == b a b b ==c b c a == c a c continue if a + b + c - max(a, b, c) > max(a, b, c):
        ans += 1 a + b + c - max(a, b, c) > max(a, b, c) a + b + c - max(a, b, c) a + b + c a + b a b c max(a, b, c) max a b c max(a, b, c) max a b c ans += 1 ans 1 print(ans) print ans ans = 0 0 ans L = list(map(int, input().split())) list(map(int, input().split())) L ans += 1 1 ans N = int(input()) int(input()) N
from itertools import combinations

N = int(input())
L = list(map(int, input().split()))

ans = 0

for a, b, c in combinations(L, 3):
    if a == b or b ==c or a == c:
        continue
    if a + b + c - max(a, b, c) > max(a, b, c):
        ans += 1

print(ans)