n = int(input())
l = list(map(int, input().split()))

def judge(l, i, j, k):
  a = l[i]
  b = l[j]
  c = l[k]
  if a != b and b != c and c != a:
    if a + b > c and b + c > a and c + a > b:
      return 1
    else:
      return 0
  else:
    return 0
cnt = 0
for i in range(n - 2):
  for j in range(i + 1, n - 1):
    for k in range(j + 1, n):
      cnt += judge(l, i, j, k)
      
print(cnt) 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 def judge(l, i, j, k):
  a = l[i]
  b = l[j]
  c = l[k]
  if a != b and b != c and c != a:
    if a + b > c and b + c > a and c + a > b:
      return 1
    else:
      return 0
  else:
    return 0 judge a = l[i] a l[i] l i b = l[j] b l[j] l j c = l[k] c l[k] l k if a != b and b != c and c != a:
    if a + b > c and b + c > a and c + a > b:
      return 1
    else:
      return 0
  else:
    return 0 a != b and b != c and c != a a != b and b != c a != b a b b != c b c c != a c a if a + b > c and b + c > a and c + a > b:
      return 1
    else:
      return 0
   a + b > c and b + c > a and c + a > b a + b > c and b + c > a a + b > c a + b a b c b + c > a b + c b c a c + a > b c + a c a b return 1 1 return 0 0 return 0 0 l l i i j j k k cnt = 0 cnt 0 for i in range(n - 2):
  for j in range(i + 1, n - 1):
    for k in range(j + 1, n):
      cnt += judge(l, i, j, k)
       i range(n - 2) range n - 2 n 2 for j in range(i + 1, n - 1):
    for k in range(j + 1, n):
      cnt += judge(l, i, j, k)
       j range(i + 1, n - 1) range i + 1 i 1 n - 1 n 1 for k in range(j + 1, n):
      cnt += judge(l, i, j, k)
       k range(j + 1, n) range j + 1 j 1 n cnt += judge(l, i, j, k) cnt judge(l, i, j, k) judge l i j k print(cnt) print cnt n = int(input()) int(input()) n cnt += judge(l, i, j, k) judge(l, i, j, k) cnt cnt = 0 0 cnt l = list(map(int, input().split())) list(map(int, input().split())) l def judge(l, i, j, k):
  a = l[i]
  b = l[j]
  c = l[k]
  if a != b and b != c and c != a:
    if a + b > c and b + c > a and c + a > b:
      return 1
    else:
      return 0
  else:
    return 0 def judge(l, i, j, k):
  a = l[i]
  b = l[j]
  c = l[k]
  if a != b and b != c and c != a:
    if a + b > c and b + c > a and c + a > b:
      return 1
    else:
      return 0
  else:
    return 0 judge
n = int(input())
l = list(map(int, input().split()))

def judge(l, i, j, k):
  a = l[i]
  b = l[j]
  c = l[k]
  if a != b and b != c and c != a:
    if a + b > c and b + c > a and c + a > b:
      return 1
    else:
      return 0
  else:
    return 0
cnt = 0
for i in range(n - 2):
  for j in range(i + 1, n - 1):
    for k in range(j + 1, n):
      cnt += judge(l, i, j, k)
      
print(cnt)