import itertools

n = int(input())
l = list(map(int, input().split()))
p_list = list(itertools.permutations(l, 3))
results = [x for x in p_list if max(x) < (sum(x) - max(x)) and len(x) == len(set(x))]
print(int(len(results) / 6)) 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 p_list = list(itertools.permutations(l, 3)) p_list list(itertools.permutations(l, 3)) list itertools.permutations(l, 3) itertools.permutations itertools permutations l 3 x for x in p_list if max(x) < (sum(x) - max(x)) and len(x) == len(set(x)) for x in p_list if max(x) < (sum(x) - max(x)) and len(x) == len(set(x)) x p_list max(x) < (sum(x) - max(x)) and len(x) == len(set(x)) max(x) < (sum(x) - max(x)) max(x) max x sum(x) - max(x) sum(x) sum x max(x) max x len(x) == len(set(x)) len(x) len x len(set(x)) len set(x) set x if max(x) < (sum(x) - max(x)) and len(x) == len(set(x)) x results = [x for x in p_list if max(x) < (sum(x) - max(x)) and len(x) == len(set(x))] results [x for x in p_list if max(x) < (sum(x) - max(x)) and len(x) == len(set(x))] print(int(len(results) / 6)) print int(len(results) / 6) int len(results) / 6 len(results) len results 6 n = int(input()) int(input()) n results = [x for x in p_list if max(x) < (sum(x) - max(x)) and len(x) == len(set(x))] [x for x in p_list if max(x) < (sum(x) - max(x)) and len(x) == len(set(x))] results l = list(map(int, input().split())) list(map(int, input().split())) l p_list = list(itertools.permutations(l, 3)) list(itertools.permutations(l, 3)) p_list
import itertools

n = int(input())
l = list(map(int, input().split()))
p_list = list(itertools.permutations(l, 3))
results = [x for x in p_list if max(x) < (sum(x) - max(x)) and len(x) == len(set(x))]
print(int(len(results) / 6))