from itertools import combinations
n = int(input())
l = list(map(int, input().split()))

ans = 0
for i,j,k in combinations(l,3):
  if i == j or i == k or j == k: continue
  if i >= j+k or j >= i+k or k >= i+j: continue
  ans += 1
print(ans) from itertools import combinations 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 ans = 0 ans 0 for i,j,k in combinations(l,3):
  if i == j or i == k or j == k: continue
  if i >= j+k or j >= i+k or k >= i+j: continue
  ans += 1 i j k combinations(l,3) combinations l 3 if i == j or i == k or j == k: continue
   i == j or i == k or j == k i == j or i == k i == j i j i == k i k j == k j k if i >= j+k or j >= i+k or k >= i+j: continue
   i >= j+k or j >= i+k or k >= i+j i >= j+k or j >= i+k i >= j+k i j+k j k j >= i+k j i+k i k k >= i+j k i+j i j ans += 1 ans 1 print(ans) print ans l = list(map(int, input().split())) list(map(int, input().split())) l n = int(input()) int(input()) n ans += 1 1 ans ans = 0 0 ans
from itertools import combinations
n = int(input())
l = list(map(int, input().split()))

ans = 0
for i,j,k in combinations(l,3):
  if i == j or i == k or j == k: continue
  if i >= j+k or j >= i+k or k >= i+j: continue
  ans += 1
print(ans)