from itertools import combinations
def triangle(l_tuple):
  if len(set(l_tuple)) == 3:
    if l_tuple[0] + l_tuple[1] > l_tuple[2] and l_tuple[1] + l_tuple[2] > l_tuple[0] and l_tuple[2] + l_tuple[0] > l_tuple[1]:
      return True
  return False
n = int(input())
l = list(map(int, input().split()))
l_comb = list(combinations(l, 3))
cnt = 0
for i in l_comb:
  if triangle(i):
    cnt += 1
print(cnt) from itertools import combinations def triangle(l_tuple):
  if len(set(l_tuple)) == 3:
    if l_tuple[0] + l_tuple[1] > l_tuple[2] and l_tuple[1] + l_tuple[2] > l_tuple[0] and l_tuple[2] + l_tuple[0] > l_tuple[1]:
      return True
  return False triangle if len(set(l_tuple)) == 3:
    if l_tuple[0] + l_tuple[1] > l_tuple[2] and l_tuple[1] + l_tuple[2] > l_tuple[0] and l_tuple[2] + l_tuple[0] > l_tuple[1]:
      return True
   len(set(l_tuple)) == 3 len(set(l_tuple)) len set(l_tuple) set l_tuple 3 if l_tuple[0] + l_tuple[1] > l_tuple[2] and l_tuple[1] + l_tuple[2] > l_tuple[0] and l_tuple[2] + l_tuple[0] > l_tuple[1]:
      return True
   l_tuple[0] + l_tuple[1] > l_tuple[2] and l_tuple[1] + l_tuple[2] > l_tuple[0] and l_tuple[2] + l_tuple[0] > l_tuple[1] l_tuple[0] + l_tuple[1] > l_tuple[2] and l_tuple[1] + l_tuple[2] > l_tuple[0] l_tuple[0] + l_tuple[1] > l_tuple[2] l_tuple[0] + l_tuple[1] l_tuple[0] l_tuple 0 l_tuple[1] l_tuple 1 l_tuple[2] l_tuple 2 l_tuple[1] + l_tuple[2] > l_tuple[0] l_tuple[1] + l_tuple[2] l_tuple[1] l_tuple 1 l_tuple[2] l_tuple 2 l_tuple[0] l_tuple 0 l_tuple[2] + l_tuple[0] > l_tuple[1] l_tuple[2] + l_tuple[0] l_tuple[2] l_tuple 2 l_tuple[0] l_tuple 0 l_tuple[1] l_tuple 1 return True True return False False l_tuple l_tuple 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 l_comb = list(combinations(l, 3)) l_comb list(combinations(l, 3)) list combinations(l, 3) combinations l 3 cnt = 0 cnt 0 for i in l_comb:
  if triangle(i):
    cnt += 1 i l_comb if triangle(i):
    cnt += 1 triangle(i) triangle i cnt += 1 cnt 1 print(cnt) print cnt cnt += 1 1 cnt l_comb = list(combinations(l, 3)) list(combinations(l, 3)) l_comb n = int(input()) int(input()) n l = list(map(int, input().split())) list(map(int, input().split())) l cnt = 0 0 cnt def triangle(l_tuple):
  if len(set(l_tuple)) == 3:
    if l_tuple[0] + l_tuple[1] > l_tuple[2] and l_tuple[1] + l_tuple[2] > l_tuple[0] and l_tuple[2] + l_tuple[0] > l_tuple[1]:
      return True
  return False def triangle(l_tuple):
  if len(set(l_tuple)) == 3:
    if l_tuple[0] + l_tuple[1] > l_tuple[2] and l_tuple[1] + l_tuple[2] > l_tuple[0] and l_tuple[2] + l_tuple[0] > l_tuple[1]:
      return True
  return False triangle
from itertools import combinations
def triangle(l_tuple):
  if len(set(l_tuple)) == 3:
    if l_tuple[0] + l_tuple[1] > l_tuple[2] and l_tuple[1] + l_tuple[2] > l_tuple[0] and l_tuple[2] + l_tuple[0] > l_tuple[1]:
      return True
  return False
n = int(input())
l = list(map(int, input().split()))
l_comb = list(combinations(l, 3))
cnt = 0
for i in l_comb:
  if triangle(i):
    cnt += 1
print(cnt)