N = int(input())
L = [int(l) for l in input().split(" ")]

def solve():
  ans = 0
  if len(L) < 3:
    return 0
  for i in range(N):
    for j in range(i, N):
      for k in range(j, N):
        if L[i] != L[j] and\
           L[j] != L[k] and\
           L[k] != L[i]:
          d = {i: L[i], j:L[j], k:L[k]}
          max_idx = max(d, key=lambda x: d[x])
          if sum(d.values()) - 2*L[max_idx] > 0:
            ans += 1# .append((i,j,k))
  return ans

print(solve()) N = int(input()) N int(input()) int input() input int(l) for l in input().split(" ") for l in input().split(" ") l input().split(" ") ().split () input split " " for l in input().split(" ") int(l) int l L = [int(l) for l in input().split(" ")] L [int(l) for l in input().split(" ")] def solve():
  ans = 0
  if len(L) < 3:
    return 0
  for i in range(N):
    for j in range(i, N):
      for k in range(j, N):
        if L[i] != L[j] and\
           L[j] != L[k] and\
           L[k] != L[i]:
          d = {i: L[i], j:L[j], k:L[k]}
          max_idx = max(d, key=lambda x: d[x])
          if sum(d.values()) - 2*L[max_idx] > 0:
            ans += 1# .append((i,j,k))
  return ans solve ans = 0 ans 0 if len(L) < 3:
    return 0
   len(L) < 3 len(L) len L 3 return 0 0 for i in range(N):
    for j in range(i, N):
      for k in range(j, N):
        if L[i] != L[j] and\
           L[j] != L[k] and\
           L[k] != L[i]:
          d = {i: L[i], j:L[j], k:L[k]}
          max_idx = max(d, key=lambda x: d[x])
          if sum(d.values()) - 2*L[max_idx] > 0:
            ans += 1# .append((i,j,k))
   i range(N) range N for j in range(i, N):
      for k in range(j, N):
        if L[i] != L[j] and\
           L[j] != L[k] and\
           L[k] != L[i]:
          d = {i: L[i], j:L[j], k:L[k]}
          max_idx = max(d, key=lambda x: d[x])
          if sum(d.values()) - 2*L[max_idx] > 0:
            ans += 1# .append((i,j,k))
   j range(i, N) range i N for k in range(j, N):
        if L[i] != L[j] and\
           L[j] != L[k] and\
           L[k] != L[i]:
          d = {i: L[i], j:L[j], k:L[k]}
          max_idx = max(d, key=lambda x: d[x])
          if sum(d.values()) - 2*L[max_idx] > 0:
            ans += 1# .append((i,j,k))
   k range(j, N) range j N if L[i] != L[j] and\
           L[j] != L[k] and\
           L[k] != L[i]:
          d = {i: L[i], j:L[j], k:L[k]}
          max_idx = max(d, key=lambda x: d[x])
          if sum(d.values()) - 2*L[max_idx] > 0:
            ans += 1# .append((i,j,k))
   L[i] != L[j] and\
           L[j] != L[k] and\
           L[k] != L[i] L[i] != L[j] and\
           L[j] != L[k] L[i] != L[j] L[i] L i L[j] L j L[j] != L[k] L[j] L j L[k] L k L[k] != L[i] L[k] L k L[i] L i d = {i: L[i], j:L[j], k:L[k]} d {i: L[i], j:L[j], k:L[k]} i i L[i] L i j j L[j] L j k k L[k] L k max_idx = max(d, key=lambda x: d[x]) max_idx max(d, key=lambda x: d[x]) max d key=lambda x: d[x] key lambda x: d[x] d[x] d x x if sum(d.values()) - 2*L[max_idx] > 0:
            ans += 1# .append((i,j,k))
   sum(d.values()) - 2*L[max_idx] > 0 sum(d.values()) - 2*L[max_idx] sum(d.values()) sum d.values() d.values d values 2*L[max_idx] 2 L[max_idx] L max_idx 0 ans += 1 ans 1 return ans ans print(solve()) print solve() solve N = int(input()) int(input()) N def solve():
  ans = 0
  if len(L) < 3:
    return 0
  for i in range(N):
    for j in range(i, N):
      for k in range(j, N):
        if L[i] != L[j] and\
           L[j] != L[k] and\
           L[k] != L[i]:
          d = {i: L[i], j:L[j], k:L[k]}
          max_idx = max(d, key=lambda x: d[x])
          if sum(d.values()) - 2*L[max_idx] > 0:
            ans += 1# .append((i,j,k))
  return ans def solve():
  ans = 0
  if len(L) < 3:
    return 0
  for i in range(N):
    for j in range(i, N):
      for k in range(j, N):
        if L[i] != L[j] and\
           L[j] != L[k] and\
           L[k] != L[i]:
          d = {i: L[i], j:L[j], k:L[k]}
          max_idx = max(d, key=lambda x: d[x])
          if sum(d.values()) - 2*L[max_idx] > 0:
            ans += 1# .append((i,j,k))
  return ans solve L = [int(l) for l in input().split(" ")] [int(l) for l in input().split(" ")] L
N = int(input())
L = [int(l) for l in input().split(" ")]

def solve():
  ans = 0
  if len(L) < 3:
    return 0
  for i in range(N):
    for j in range(i, N):
      for k in range(j, N):
        if L[i] != L[j] and\
           L[j] != L[k] and\
           L[k] != L[i]:
          d = {i: L[i], j:L[j], k:L[k]}
          max_idx = max(d, key=lambda x: d[x])
          if sum(d.values()) - 2*L[max_idx] > 0:
            ans += 1# .append((i,j,k))
  return ans

print(solve())