io = DATA.eof? ? STDIN : DATA
n=io.gets.to_i
l=io.gets.split.map(&:to_i)
cnt=0
(0...n).to_a.combination(3).each do |i,j,k|
  a,b,c=[l[i],l[j],l[k]].sort
  next if a==b || b==c
  if a+b>c
    cnt+=1
  end
end
puts cnt

__END__
