import itertools

input()
rods = list(map(int, input().split(" ")))
sorted_rods = sorted(rods)

count = 0
for combination in itertools.combinations(sorted_rods, 3):
  a, b, c = combination
  if a != b and b != c:
    if a + b > c:
      count += 1
      
print(count) import itertools itertools input() input rods = list(map(int, input().split(" "))) rods list(map(int, input().split(" "))) list map(int, input().split(" ")) map int input().split(" ") ().split () input split " " sorted_rods = sorted(rods) sorted_rods sorted(rods) sorted rods count = 0 count 0 for combination in itertools.combinations(sorted_rods, 3):
  a, b, c = combination
  if a != b and b != c:
    if a + b > c:
      count += 1
       combination itertools.combinations(sorted_rods, 3) itertools.combinations itertools combinations sorted_rods 3 a, b, c = combination a combination b c if a != b and b != c:
    if a + b > c:
      count += 1
       a != b and b != c a != b a b b != c b c if a + b > c:
      count += 1
       a + b > c a + b a b c count += 1 count 1 print(count) print count rods = list(map(int, input().split(" "))) list(map(int, input().split(" "))) rods b, c = combination combination b c = combination combination c sorted_rods = sorted(rods) sorted(rods) sorted_rods count = 0 0 count count += 1 1 count a, b, c = combination combination a
import itertools

input()
rods = list(map(int, input().split(" ")))
sorted_rods = sorted(rods)

count = 0
for combination in itertools.combinations(sorted_rods, 3):
  a, b, c = combination
  if a != b and b != c:
    if a + b > c:
      count += 1
      
print(count)