from itertools import combinations

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

count = 0
for C in combinations(L, 3):
    l_list = list(C)
    l_list.sort()

    if l_list[2] > l_list[1] and l_list[1] > l_list[0]:
        if l_list[2] < l_list[1] + l_list[0]:
            count += 1

print(count) 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 count = 0 count 0 for C in combinations(L, 3):
    l_list = list(C)
    l_list.sort()

    if l_list[2] > l_list[1] and l_list[1] > l_list[0]:
        if l_list[2] < l_list[1] + l_list[0]:
            count += 1 C combinations(L, 3) combinations L 3 l_list = list(C) l_list list(C) list C l_list.sort() l_list.sort l_list sort if l_list[2] > l_list[1] and l_list[1] > l_list[0]:
        if l_list[2] < l_list[1] + l_list[0]:
            count += 1 l_list[2] > l_list[1] and l_list[1] > l_list[0] l_list[2] > l_list[1] l_list[2] l_list 2 l_list[1] l_list 1 l_list[1] > l_list[0] l_list[1] l_list 1 l_list[0] l_list 0 if l_list[2] < l_list[1] + l_list[0]:
            count += 1 l_list[2] < l_list[1] + l_list[0] l_list[2] l_list 2 l_list[1] + l_list[0] l_list[1] l_list 1 l_list[0] l_list 0 count += 1 count 1 print(count) print count count = 0 0 count l_list = list(C) list(C) l_list count += 1 1 count N = int(input()) int(input()) N L = list(map(int, input().split())) list(map(int, input().split())) L
from itertools import combinations

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

count = 0
for C in combinations(L, 3):
    l_list = list(C)
    l_list.sort()

    if l_list[2] > l_list[1] and l_list[1] > l_list[0]:
        if l_list[2] < l_list[1] + l_list[0]:
            count += 1

print(count)