import itertools

def is_triangle(list_L):
    
    if (list_L[0] + list_L[1] > list_L[2]) and (list_L[1] + list_L[2] > list_L[0]) and (list_L[2] + list_L[0] > list_L[1]) :
        return True
    else :
        return False

def is_uniqueL(list_L):

    return len(list_L) == len(set(list_L))

N = int(input())
L = map(int,input().split())

comb_L = list(itertools.combinations(L, 3))

sum = 0

for a_comb_L in comb_L :

    if is_uniqueL(a_comb_L) == True and is_triangle(a_comb_L) == True:
        sum += 1

print(sum) import itertools itertools def is_triangle(list_L):
    
    if (list_L[0] + list_L[1] > list_L[2]) and (list_L[1] + list_L[2] > list_L[0]) and (list_L[2] + list_L[0] > list_L[1]) :
        return True
    else :
        return False is_triangle if (list_L[0] + list_L[1] > list_L[2]) and (list_L[1] + list_L[2] > list_L[0]) and (list_L[2] + list_L[0] > list_L[1]) :
        return True
    else :
        return False (list_L[0] + list_L[1] > list_L[2]) and (list_L[1] + list_L[2] > list_L[0]) and (list_L[2] + list_L[0] > list_L[1]) (list_L[0] + list_L[1] > list_L[2]) and (list_L[1] + list_L[2] > list_L[0]) list_L[0] + list_L[1] > list_L[2] list_L[0] + list_L[1] list_L[0] list_L 0 list_L[1] list_L 1 list_L[2] list_L 2 list_L[1] + list_L[2] > list_L[0] list_L[1] + list_L[2] list_L[1] list_L 1 list_L[2] list_L 2 list_L[0] list_L 0 list_L[2] + list_L[0] > list_L[1] list_L[2] + list_L[0] list_L[2] list_L 2 list_L[0] list_L 0 list_L[1] list_L 1 return True True return False False list_L list_L def is_uniqueL(list_L):

    return len(list_L) == len(set(list_L)) is_uniqueL return len(list_L) == len(set(list_L)) len(list_L) == len(set(list_L)) len(list_L) len list_L len(set(list_L)) len set(list_L) set list_L list_L list_L N = int(input()) N int(input()) int input() input L = map(int,input().split()) L map(int,input().split()) map int input().split() ().split () input split comb_L = list(itertools.combinations(L, 3)) comb_L list(itertools.combinations(L, 3)) list itertools.combinations(L, 3) itertools.combinations itertools combinations L 3 sum = 0 sum 0 for a_comb_L in comb_L :

    if is_uniqueL(a_comb_L) == True and is_triangle(a_comb_L) == True:
        sum += 1 a_comb_L comb_L if is_uniqueL(a_comb_L) == True and is_triangle(a_comb_L) == True:
        sum += 1 is_uniqueL(a_comb_L) == True and is_triangle(a_comb_L) == True is_uniqueL(a_comb_L) == True is_uniqueL(a_comb_L) is_uniqueL a_comb_L True is_triangle(a_comb_L) == True is_triangle(a_comb_L) is_triangle a_comb_L True sum += 1 sum 1 print(sum) print sum L = map(int,input().split()) map(int,input().split()) L sum = 0 0 sum def is_uniqueL(list_L):

    return len(list_L) == len(set(list_L)) def is_uniqueL(list_L):

    return len(list_L) == len(set(list_L)) is_uniqueL def is_triangle(list_L):
    
    if (list_L[0] + list_L[1] > list_L[2]) and (list_L[1] + list_L[2] > list_L[0]) and (list_L[2] + list_L[0] > list_L[1]) :
        return True
    else :
        return False def is_triangle(list_L):
    
    if (list_L[0] + list_L[1] > list_L[2]) and (list_L[1] + list_L[2] > list_L[0]) and (list_L[2] + list_L[0] > list_L[1]) :
        return True
    else :
        return False is_triangle N = int(input()) int(input()) N sum += 1 1 sum comb_L = list(itertools.combinations(L, 3)) list(itertools.combinations(L, 3)) comb_L
import itertools

def is_triangle(list_L):
    
    if (list_L[0] + list_L[1] > list_L[2]) and (list_L[1] + list_L[2] > list_L[0]) and (list_L[2] + list_L[0] > list_L[1]) :
        return True
    else :
        return False

def is_uniqueL(list_L):

    return len(list_L) == len(set(list_L))

N = int(input())
L = map(int,input().split())

comb_L = list(itertools.combinations(L, 3))

sum = 0

for a_comb_L in comb_L :

    if is_uniqueL(a_comb_L) == True and is_triangle(a_comb_L) == True:
        sum += 1

print(sum)