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

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

for c in c_list:
    if (c[0]+c[1])>c[2] and (c[1]+c[2])>c[0] and (c[2]+c[0])>c[1]:
        if len(set(c)) == 3:
            count += 1

print(count)