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