tmp = input()
line = input().split(" ")
for i in range(len(line)):
  line[i] = int(line[i])
line.sort()
count = 0
for i in range(0, len(line) - 2):
  for j in range(1, len(line) - 1):
    if i > j or i == j:
      continue
    for k in range(2, len(line)):
      if j > k or j == k:
        continue
      if int(line[i]) != int(line[j]) and int(line[j]) != int(line[k]):
        if int(line[i]) + int(line[j]) > int(line[k]):
          count += 1
print(count) tmp = input() tmp input() input line = input().split(" ") line input().split(" ") ().split () input split " " for i in range(len(line)):
  line[i] = int(line[i]) i range(len(line)) range len(line) len line line[i] = int(line[i]) line[i] line i int(line[i]) int line[i] line i line.sort() line.sort line sort count = 0 count 0 for i in range(0, len(line) - 2):
  for j in range(1, len(line) - 1):
    if i > j or i == j:
      continue
    for k in range(2, len(line)):
      if j > k or j == k:
        continue
      if int(line[i]) != int(line[j]) and int(line[j]) != int(line[k]):
        if int(line[i]) + int(line[j]) > int(line[k]):
          count += 1 i range(0, len(line) - 2) range 0 len(line) - 2 len(line) len line 2 for j in range(1, len(line) - 1):
    if i > j or i == j:
      continue
    for k in range(2, len(line)):
      if j > k or j == k:
        continue
      if int(line[i]) != int(line[j]) and int(line[j]) != int(line[k]):
        if int(line[i]) + int(line[j]) > int(line[k]):
          count += 1 j range(1, len(line) - 1) range 1 len(line) - 1 len(line) len line 1 if i > j or i == j:
      continue
     i > j or i == j i > j i j i == j i j continue for k in range(2, len(line)):
      if j > k or j == k:
        continue
      if int(line[i]) != int(line[j]) and int(line[j]) != int(line[k]):
        if int(line[i]) + int(line[j]) > int(line[k]):
          count += 1 k range(2, len(line)) range 2 len(line) len line if j > k or j == k:
        continue
       j > k or j == k j > k j k j == k j k continue if int(line[i]) != int(line[j]) and int(line[j]) != int(line[k]):
        if int(line[i]) + int(line[j]) > int(line[k]):
          count += 1 int(line[i]) != int(line[j]) and int(line[j]) != int(line[k]) int(line[i]) != int(line[j]) int(line[i]) int line[i] line i int(line[j]) int line[j] line j int(line[j]) != int(line[k]) int(line[j]) int line[j] line j int(line[k]) int line[k] line k if int(line[i]) + int(line[j]) > int(line[k]):
          count += 1 int(line[i]) + int(line[j]) > int(line[k]) int(line[i]) + int(line[j]) int(line[i]) int line[i] line i int(line[j]) int line[j] line j int(line[k]) int line[k] line k count += 1 count 1 print(count) print count line = input().split(" ") input().split(" ") line count = 0 0 count count += 1 1 count tmp = input() input() tmp
tmp = input()
line = input().split(" ")
for i in range(len(line)):
  line[i] = int(line[i])
line.sort()
count = 0
for i in range(0, len(line) - 2):
  for j in range(1, len(line) - 1):
    if i > j or i == j:
      continue
    for k in range(2, len(line)):
      if j > k or j == k:
        continue
      if int(line[i]) != int(line[j]) and int(line[j]) != int(line[k]):
        if int(line[i]) + int(line[j]) > int(line[k]):
          count += 1
print(count)