import itertools
n = int(input())
l = list(map(int, input().split()))    
count = 0
ind_list = list(itertools.combinations(range(0,n), 3))

for ind in ind_list:
    if (l[ind[0]]+l[ind[1]])>l[ind[2]] and (l[ind[1]]+l[ind[2]])>l[ind[0]] and (l[ind[2]]+l[ind[0]])>l[ind[1]]:
        if l[ind[0]]!=l[ind[1]] and l[ind[0]]!=l[ind[2]] and l[ind[1]]!=l[ind[2]]:
            count += 1

print(count) 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 count = 0 count 0 ind_list = list(itertools.combinations(range(0,n), 3)) ind_list list(itertools.combinations(range(0,n), 3)) list itertools.combinations(range(0,n), 3) itertools.combinations itertools combinations range(0,n) range 0 n 3 for ind in ind_list:
    if (l[ind[0]]+l[ind[1]])>l[ind[2]] and (l[ind[1]]+l[ind[2]])>l[ind[0]] and (l[ind[2]]+l[ind[0]])>l[ind[1]]:
        if l[ind[0]]!=l[ind[1]] and l[ind[0]]!=l[ind[2]] and l[ind[1]]!=l[ind[2]]:
            count += 1 ind ind_list if (l[ind[0]]+l[ind[1]])>l[ind[2]] and (l[ind[1]]+l[ind[2]])>l[ind[0]] and (l[ind[2]]+l[ind[0]])>l[ind[1]]:
        if l[ind[0]]!=l[ind[1]] and l[ind[0]]!=l[ind[2]] and l[ind[1]]!=l[ind[2]]:
            count += 1 (l[ind[0]]+l[ind[1]])>l[ind[2]] and (l[ind[1]]+l[ind[2]])>l[ind[0]] and (l[ind[2]]+l[ind[0]])>l[ind[1]] (l[ind[0]]+l[ind[1]])>l[ind[2]] and (l[ind[1]]+l[ind[2]])>l[ind[0]] (l[ind[0]]+l[ind[1]])>l[ind[2]] l[ind[0]]+l[ind[1]] l[ind[0]] l ind[0] ind 0 l[ind[1]] l ind[1] ind 1 l[ind[2]] l ind[2] ind 2 (l[ind[1]]+l[ind[2]])>l[ind[0]] l[ind[1]]+l[ind[2]] l[ind[1]] l ind[1] ind 1 l[ind[2]] l ind[2] ind 2 l[ind[0]] l ind[0] ind 0 (l[ind[2]]+l[ind[0]])>l[ind[1]] l[ind[2]]+l[ind[0]] l[ind[2]] l ind[2] ind 2 l[ind[0]] l ind[0] ind 0 l[ind[1]] l ind[1] ind 1 if l[ind[0]]!=l[ind[1]] and l[ind[0]]!=l[ind[2]] and l[ind[1]]!=l[ind[2]]:
            count += 1 l[ind[0]]!=l[ind[1]] and l[ind[0]]!=l[ind[2]] and l[ind[1]]!=l[ind[2]] l[ind[0]]!=l[ind[1]] and l[ind[0]]!=l[ind[2]] l[ind[0]]!=l[ind[1]] l[ind[0]] l ind[0] ind 0 l[ind[1]] l ind[1] ind 1 l[ind[0]]!=l[ind[2]] l[ind[0]] l ind[0] ind 0 l[ind[2]] l ind[2] ind 2 l[ind[1]]!=l[ind[2]] l[ind[1]] l ind[1] ind 1 l[ind[2]] l ind[2] ind 2 count += 1 count 1 print(count) print count ind_list = list(itertools.combinations(range(0,n), 3)) list(itertools.combinations(range(0,n), 3)) ind_list l = list(map(int, input().split())) list(map(int, input().split())) l n = int(input()) int(input()) n count += 1 1 count count = 0 0 count
import itertools
n = int(input())
l = list(map(int, input().split()))    
count = 0
ind_list = list(itertools.combinations(range(0,n), 3))

for ind in ind_list:
    if (l[ind[0]]+l[ind[1]])>l[ind[2]] and (l[ind[1]]+l[ind[2]])>l[ind[0]] and (l[ind[2]]+l[ind[0]])>l[ind[1]]:
        if l[ind[0]]!=l[ind[1]] and l[ind[0]]!=l[ind[2]] and l[ind[1]]!=l[ind[2]]:
            count += 1

print(count)