import itertools
import sys
N = int(input())
if N < 3:
  print(0)
  sys.exit()
 
#辺を取得してint型に変換
hen_list = input().split()
for i in range(len(hen_list)):
    hen_list[i] = int(hen_list[i])
 
#組み合わせ
count = 0
for tri in itertools.combinations(hen_list, 3):
    sort_tri = sorted(tri)
    if sort_tri[0] + sort_tri[1] > sort_tri[2]:
        if tri[0] != tri[1] and tri[0] != tri[2] and tri[1] != tri[2]:
            #print(sort_tri)
            count += 1
print(count) import itertools itertools import sys sys N = int(input()) N int(input()) int input() input if N < 3:
  print(0)
  sys.exit()
 
#辺を取得してint型に変換 N < 3 N 3 print(0) print 0 sys.exit() sys.exit sys exit hen_list = input().split() hen_list input().split() ().split () input split for i in range(len(hen_list)):
    hen_list[i] = int(hen_list[i])
 
#組み合わせ i range(len(hen_list)) range len(hen_list) len hen_list hen_list[i] = int(hen_list[i]) hen_list[i] hen_list i int(hen_list[i]) int hen_list[i] hen_list i count = 0 count 0 for tri in itertools.combinations(hen_list, 3):
    sort_tri = sorted(tri)
    if sort_tri[0] + sort_tri[1] > sort_tri[2]:
        if tri[0] != tri[1] and tri[0] != tri[2] and tri[1] != tri[2]:
            #print(sort_tri)
            count += 1 tri itertools.combinations(hen_list, 3) itertools.combinations itertools combinations hen_list 3 sort_tri = sorted(tri) sort_tri sorted(tri) sorted tri if sort_tri[0] + sort_tri[1] > sort_tri[2]:
        if tri[0] != tri[1] and tri[0] != tri[2] and tri[1] != tri[2]:
            #print(sort_tri)
            count += 1 sort_tri[0] + sort_tri[1] > sort_tri[2] sort_tri[0] + sort_tri[1] sort_tri[0] sort_tri 0 sort_tri[1] sort_tri 1 sort_tri[2] sort_tri 2 if tri[0] != tri[1] and tri[0] != tri[2] and tri[1] != tri[2]:
            #print(sort_tri)
            count += 1 tri[0] != tri[1] and tri[0] != tri[2] and tri[1] != tri[2] tri[0] != tri[1] and tri[0] != tri[2] tri[0] != tri[1] tri[0] tri 0 tri[1] tri 1 tri[0] != tri[2] tri[0] tri 0 tri[2] tri 2 tri[1] != tri[2] tri[1] tri 1 tri[2] tri 2 count += 1 count 1 print(count) print count count += 1 1 count sort_tri = sorted(tri) sorted(tri) sort_tri N = int(input()) int(input()) N hen_list = input().split() input().split() hen_list count = 0 0 count
import itertools
import sys
N = int(input())
if N < 3:
  print(0)
  sys.exit()
 
#辺を取得してint型に変換
hen_list = input().split()
for i in range(len(hen_list)):
    hen_list[i] = int(hen_list[i])
 
#組み合わせ
count = 0
for tri in itertools.combinations(hen_list, 3):
    sort_tri = sorted(tri)
    if sort_tri[0] + sort_tri[1] > sort_tri[2]:
        if tri[0] != tri[1] and tri[0] != tri[2] and tri[1] != tri[2]:
            #print(sort_tri)
            count += 1
print(count)