#!/usr/bin/env python3
import itertools

N = int(input().split()[0])
l_list = list(map(int, input().split()))

p_gen = itertools.combinations(range(len(l_list)), 3)
tri_list = []
for pattern in p_gen:
    i, j, k = sorted(list(pattern))
    w_list = sorted([l_list[i], l_list[j], l_list[k]])
    if len(set(w_list)) == 3:
        if w_list[2] < w_list[0] + w_list[1]:
            tri_list.append((i, j, k))
ans = len(tri_list)
print(ans) import itertools itertools N = int(input().split()[0]) N int(input().split()[0]) int input().split()[0] ().split() ().split () input split 0 l_list = list(map(int, input().split())) l_list list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split p_gen = itertools.combinations(range(len(l_list)), 3) p_gen itertools.combinations(range(len(l_list)), 3) itertools.combinations itertools combinations range(len(l_list)) range len(l_list) len l_list 3 tri_list = [] tri_list [] for pattern in p_gen:
    i, j, k = sorted(list(pattern))
    w_list = sorted([l_list[i], l_list[j], l_list[k]])
    if len(set(w_list)) == 3:
        if w_list[2] < w_list[0] + w_list[1]:
            tri_list.append((i, j, k)) pattern p_gen i, j, k = sorted(list(pattern)) i sorted(list(pattern)) sorted list(pattern) list pattern j k w_list = sorted([l_list[i], l_list[j], l_list[k]]) w_list sorted([l_list[i], l_list[j], l_list[k]]) sorted [l_list[i], l_list[j], l_list[k]] l_list[i] l_list i l_list[j] l_list j l_list[k] l_list k if len(set(w_list)) == 3:
        if w_list[2] < w_list[0] + w_list[1]:
            tri_list.append((i, j, k)) len(set(w_list)) == 3 len(set(w_list)) len set(w_list) set w_list 3 if w_list[2] < w_list[0] + w_list[1]:
            tri_list.append((i, j, k)) w_list[2] < w_list[0] + w_list[1] w_list[2] w_list 2 w_list[0] + w_list[1] w_list[0] w_list 0 w_list[1] w_list 1 tri_list.append((i, j, k)) tri_list.append tri_list append (i, j, k) i j k ans = len(tri_list) ans len(tri_list) len tri_list print(ans) print ans l_list = list(map(int, input().split())) list(map(int, input().split())) l_list w_list = sorted([l_list[i], l_list[j], l_list[k]]) sorted([l_list[i], l_list[j], l_list[k]]) w_list k = sorted(list(pattern)) sorted(list(pattern)) k ans = len(tri_list) len(tri_list) ans tri_list = [] [] tri_list N = int(input().split()[0]) int(input().split()[0]) N p_gen = itertools.combinations(range(len(l_list)), 3) itertools.combinations(range(len(l_list)), 3) p_gen i, j, k = sorted(list(pattern)) sorted(list(pattern)) i j, k = sorted(list(pattern)) sorted(list(pattern)) j
#!/usr/bin/env python3
import itertools

N = int(input().split()[0])
l_list = list(map(int, input().split()))

p_gen = itertools.combinations(range(len(l_list)), 3)
tri_list = []
for pattern in p_gen:
    i, j, k = sorted(list(pattern))
    w_list = sorted([l_list[i], l_list[j], l_list[k]])
    if len(set(w_list)) == 3:
        if w_list[2] < w_list[0] + w_list[1]:
            tri_list.append((i, j, k))
ans = len(tri_list)
print(ans)
