import itertools
n = int(input())
l = list(map(int, input().split()))
num = 0
for i,h,j in itertools.combinations(l,3):
    if i+h>j and h+j>i and j+i>h and j!=i and i!=h and h!=j:
        num += 1
print(num) 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 num = 0 num 0 for i,h,j in itertools.combinations(l,3):
    if i+h>j and h+j>i and j+i>h and j!=i and i!=h and h!=j:
        num += 1 i h j itertools.combinations(l,3) itertools.combinations itertools combinations l 3 if i+h>j and h+j>i and j+i>h and j!=i and i!=h and h!=j:
        num += 1 i+h>j and h+j>i and j+i>h and j!=i and i!=h and h!=j i+h>j and h+j>i and j+i>h and j!=i and i!=h i+h>j and h+j>i and j+i>h and j!=i i+h>j and h+j>i and j+i>h i+h>j and h+j>i i+h>j i+h i h j h+j>i h+j h j i j+i>h j+i j i h j!=i j i i!=h i h h!=j h j num += 1 num 1 print(num) print num n = int(input()) int(input()) n l = list(map(int, input().split())) list(map(int, input().split())) l num += 1 1 num num = 0 0 num
import itertools
n = int(input())
l = list(map(int, input().split()))
num = 0
for i,h,j in itertools.combinations(l,3):
    if i+h>j and h+j>i and j+i>h and j!=i and i!=h and h!=j:
        num += 1
print(num)