from itertools import combinations

n = int(input())
len_list = list(map(int, input().split()))
len_list = sorted(len_list)
#print(len_list)

per_len = list(combinations(len_list, 3))
#print(per_len)
count = 0

for i in range(len(per_len)):
    if per_len[i][2] == per_len[i][0] or per_len[i][1] == per_len[i][2] or per_len[i][0] == per_len[i][1]:
        pass
    
    else:
        if per_len[i][2] < per_len[i][0] + per_len[i][1] :
            count += 1
            #print(i)
            #print(count)

print(count) from itertools import combinations n = int(input()) n int(input()) int input() input len_list = list(map(int, input().split())) len_list list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split len_list = sorted(len_list) len_list sorted(len_list) sorted len_list per_len = list(combinations(len_list, 3)) per_len list(combinations(len_list, 3)) list combinations(len_list, 3) combinations len_list 3 count = 0 count 0 for i in range(len(per_len)):
    if per_len[i][2] == per_len[i][0] or per_len[i][1] == per_len[i][2] or per_len[i][0] == per_len[i][1]:
        pass
    
    else:
        if per_len[i][2] < per_len[i][0] + per_len[i][1] :
            count += 1
            #print(i)
            #print(count) i range(len(per_len)) range len(per_len) len per_len if per_len[i][2] == per_len[i][0] or per_len[i][1] == per_len[i][2] or per_len[i][0] == per_len[i][1]:
        pass
    
    else:
        if per_len[i][2] < per_len[i][0] + per_len[i][1] :
            count += 1
            #print(i)
            #print(count) per_len[i][2] == per_len[i][0] or per_len[i][1] == per_len[i][2] or per_len[i][0] == per_len[i][1] per_len[i][2] == per_len[i][0] or per_len[i][1] == per_len[i][2] per_len[i][2] == per_len[i][0] per_len[i][2] [i] per_len i 2 per_len[i][0] [i] per_len i 0 per_len[i][1] == per_len[i][2] per_len[i][1] [i] per_len i 1 per_len[i][2] [i] per_len i 2 per_len[i][0] == per_len[i][1] per_len[i][0] [i] per_len i 0 per_len[i][1] [i] per_len i 1 if per_len[i][2] < per_len[i][0] + per_len[i][1] :
            count += 1
            #print(i)
            #print(count) per_len[i][2] < per_len[i][0] + per_len[i][1] per_len[i][2] [i] per_len i 2 per_len[i][0] + per_len[i][1] per_len[i][0] [i] per_len i 0 per_len[i][1] [i] per_len i 1 count += 1 count 1 print(count) print count len_list = list(map(int, input().split())) list(map(int, input().split())) len_list per_len = list(combinations(len_list, 3)) list(combinations(len_list, 3)) per_len count += 1 1 count n = int(input()) int(input()) n count = 0 0 count len_list = sorted(len_list) sorted(len_list) len_list
from itertools import combinations

n = int(input())
len_list = list(map(int, input().split()))
len_list = sorted(len_list)
#print(len_list)

per_len = list(combinations(len_list, 3))
#print(per_len)
count = 0

for i in range(len(per_len)):
    if per_len[i][2] == per_len[i][0] or per_len[i][1] == per_len[i][2] or per_len[i][0] == per_len[i][1]:
        pass
    
    else:
        if per_len[i][2] < per_len[i][0] + per_len[i][1] :
            count += 1
            #print(i)
            #print(count)

print(count)