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

if N < 3:
  print(0)
  exit(0)

import itertools as it
per = it.combinations(S,r=3)

cnt = 0
for r in per:
  a,b,c = r
  if a ==  b or b == c or a == c:
    continue
    
  if a+b > c and b+c > a and a+c > b:
    #print(a,b,c)
    cnt += 1
    
print(cnt) N = int(input()) N int(input()) int input() input S = list(map(int,input().split())) S list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split if N < 3:
  print(0)
  exit(0) N < 3 N 3 print(0) print 0 exit(0) exit 0 import itertools as it itertools per = it.combinations(S,r=3) per it.combinations(S,r=3) it.combinations it combinations S r=3 r 3 cnt = 0 cnt 0 for r in per:
  a,b,c = r
  if a ==  b or b == c or a == c:
    continue
    
  if a+b > c and b+c > a and a+c > b:
    #print(a,b,c)
    cnt += 1
     r per a,b,c = r a r b c if a ==  b or b == c or a == c:
    continue
    
   a ==  b or b == c or a == c a ==  b or b == c a ==  b a b b == c b c a == c a c continue if a+b > c and b+c > a and a+c > b:
    #print(a,b,c)
    cnt += 1
     a+b > c and b+c > a and a+c > b a+b > c and b+c > a a+b > c a+b a b c b+c > a b+c b c a a+c > b a+c a c b cnt += 1 cnt 1 print(cnt) print cnt cnt += 1 1 cnt N = int(input()) int(input()) N c = r r c b,c = r r b cnt = 0 0 cnt per = it.combinations(S,r=3) it.combinations(S,r=3) per S = list(map(int,input().split())) list(map(int,input().split())) S a,b,c = r r a
N = int(input())
S = list(map(int,input().split()))

if N < 3:
  print(0)
  exit(0)

import itertools as it
per = it.combinations(S,r=3)

cnt = 0
for r in per:
  a,b,c = r
  if a ==  b or b == c or a == c:
    continue
    
  if a+b > c and b+c > a and a+c > b:
    #print(a,b,c)
    cnt += 1
    
print(cnt)
