cnt = 0
n = int(input())
l = list(map(int, input().split()))
if len(l) >= 3:
  for i in range(len(l)):
    for j in range(i, len(l)):
      for k in range(j, len(l)):
        if l[i] == l[j] or l[i] == l[k] or l[j] == l[k]:
          continue
        elif l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[j] + l[k] > l[i]:
          cnt += 1
        else:
          continue
print(cnt)  cnt = 0 cnt 0 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 if len(l) >= 3:
  for i in range(len(l)):
    for j in range(i, len(l)):
      for k in range(j, len(l)):
        if l[i] == l[j] or l[i] == l[k] or l[j] == l[k]:
          continue
        elif l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[j] + l[k] > l[i]:
          cnt += 1
        else:
          continue len(l) >= 3 len(l) len l 3 for i in range(len(l)):
    for j in range(i, len(l)):
      for k in range(j, len(l)):
        if l[i] == l[j] or l[i] == l[k] or l[j] == l[k]:
          continue
        elif l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[j] + l[k] > l[i]:
          cnt += 1
        else:
          continue i range(len(l)) range len(l) len l for j in range(i, len(l)):
      for k in range(j, len(l)):
        if l[i] == l[j] or l[i] == l[k] or l[j] == l[k]:
          continue
        elif l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[j] + l[k] > l[i]:
          cnt += 1
        else:
          continue j range(i, len(l)) range i len(l) len l for k in range(j, len(l)):
        if l[i] == l[j] or l[i] == l[k] or l[j] == l[k]:
          continue
        elif l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[j] + l[k] > l[i]:
          cnt += 1
        else:
          continue k range(j, len(l)) range j len(l) len l if l[i] == l[j] or l[i] == l[k] or l[j] == l[k]:
          continue
        elif l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[j] + l[k] > l[i]:
          cnt += 1
        else:
          continue l[i] == l[j] or l[i] == l[k] or l[j] == l[k] l[i] == l[j] or l[i] == l[k] l[i] == l[j] l[i] l i l[j] l j l[i] == l[k] l[i] l i l[k] l k l[j] == l[k] l[j] l j l[k] l k continue elif l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[j] + l[k] > l[i]:
          cnt += 1
         l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[j] + l[k] > l[i] l[i] + l[j] > l[k] and l[i] + l[k] > l[j] l[i] + l[j] > l[k] l[i] + l[j] l[i] l i l[j] l j l[k] l k l[i] + l[k] > l[j] l[i] + l[k] l[i] l i l[k] l k l[j] l j l[j] + l[k] > l[i] l[j] + l[k] l[j] l j l[k] l k l[i] l i cnt += 1 cnt 1 continue print(cnt) print cnt cnt = 0 0 cnt n = int(input()) int(input()) n l = list(map(int, input().split())) list(map(int, input().split())) l cnt += 1 1 cnt
cnt = 0
n = int(input())
l = list(map(int, input().split()))
if len(l) >= 3:
  for i in range(len(l)):
    for j in range(i, len(l)):
      for k in range(j, len(l)):
        if l[i] == l[j] or l[i] == l[k] or l[j] == l[k]:
          continue
        elif l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[j] + l[k] > l[i]:
          cnt += 1
        else:
          continue
print(cnt) 