import itertools
N = int(input())
L = list(map(int,input().split()))
tri_list = list(itertools.combinations(L,3))
num = 0
for i in range(len(tri_list)):
    combi = tri_list[i]
    if (combi[0] != combi[1]) and (combi[1] != combi[2]) and (combi[2] != combi[0]):
        if ((abs(combi[0] - combi[1])) < combi[2]) and (combi[2] < (combi[0] + combi[1])):
            num += 1
print(num) import itertools itertools 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 tri_list = list(itertools.combinations(L,3)) tri_list list(itertools.combinations(L,3)) list itertools.combinations(L,3) itertools.combinations itertools combinations L 3 num = 0 num 0 for i in range(len(tri_list)):
    combi = tri_list[i]
    if (combi[0] != combi[1]) and (combi[1] != combi[2]) and (combi[2] != combi[0]):
        if ((abs(combi[0] - combi[1])) < combi[2]) and (combi[2] < (combi[0] + combi[1])):
            num += 1 i range(len(tri_list)) range len(tri_list) len tri_list combi = tri_list[i] combi tri_list[i] tri_list i if (combi[0] != combi[1]) and (combi[1] != combi[2]) and (combi[2] != combi[0]):
        if ((abs(combi[0] - combi[1])) < combi[2]) and (combi[2] < (combi[0] + combi[1])):
            num += 1 (combi[0] != combi[1]) and (combi[1] != combi[2]) and (combi[2] != combi[0]) (combi[0] != combi[1]) and (combi[1] != combi[2]) combi[0] != combi[1] combi[0] combi 0 combi[1] combi 1 combi[1] != combi[2] combi[1] combi 1 combi[2] combi 2 combi[2] != combi[0] combi[2] combi 2 combi[0] combi 0 if ((abs(combi[0] - combi[1])) < combi[2]) and (combi[2] < (combi[0] + combi[1])):
            num += 1 ((abs(combi[0] - combi[1])) < combi[2]) and (combi[2] < (combi[0] + combi[1])) (abs(combi[0] - combi[1])) < combi[2] abs(combi[0] - combi[1]) abs combi[0] - combi[1] combi[0] combi 0 combi[1] combi 1 combi[2] combi 2 combi[2] < (combi[0] + combi[1]) combi[2] combi 2 combi[0] + combi[1] combi[0] combi 0 combi[1] combi 1 num += 1 num 1 print(num) print num num = 0 0 num combi = tri_list[i] tri_list[i] combi N = int(input()) int(input()) N num += 1 1 num tri_list = list(itertools.combinations(L,3)) list(itertools.combinations(L,3)) tri_list L = list(map(int,input().split())) list(map(int,input().split())) L
import itertools
N = int(input())
L = list(map(int,input().split()))
tri_list = list(itertools.combinations(L,3))
num = 0
for i in range(len(tri_list)):
    combi = tri_list[i]
    if (combi[0] != combi[1]) and (combi[1] != combi[2]) and (combi[2] != combi[0]):
        if ((abs(combi[0] - combi[1])) < combi[2]) and (combi[2] < (combi[0] + combi[1])):
            num += 1
print(num)