from itertools import combinations

N = int(input())
L = list(map(int, input().split()))

ans = 0
for i, j, k in combinations(range(N),3):
  ell = sorted([L[i], L[j], L[k]])
  if ell[2] < ell[0] + ell[1] and len(set(ell)) == 3:
    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(range(N),3):
  ell = sorted([L[i], L[j], L[k]])
  if ell[2] < ell[0] + ell[1] and len(set(ell)) == 3:
    ans += 1 i j k combinations(range(N),3) combinations range(N) range N 3 ell = sorted([L[i], L[j], L[k]]) ell sorted([L[i], L[j], L[k]]) sorted [L[i], L[j], L[k]] L[i] L i L[j] L j L[k] L k if ell[2] < ell[0] + ell[1] and len(set(ell)) == 3:
    ans += 1 ell[2] < ell[0] + ell[1] and len(set(ell)) == 3 ell[2] < ell[0] + ell[1] ell[2] ell 2 ell[0] + ell[1] ell[0] ell 0 ell[1] ell 1 len(set(ell)) == 3 len(set(ell)) len set(ell) set ell 3 ans += 1 ans 1 print(ans) print ans ans = 0 0 ans ell = sorted([L[i], L[j], L[k]]) sorted([L[i], L[j], L[k]]) ell L = list(map(int, input().split())) list(map(int, input().split())) L N = int(input()) int(input()) N ans += 1 1 ans
from itertools import combinations

N = int(input())
L = list(map(int, input().split()))

ans = 0
for i, j, k in combinations(range(N),3):
  ell = sorted([L[i], L[j], L[k]])
  if ell[2] < ell[0] + ell[1] and len(set(ell)) == 3:
    ans += 1
print(ans)