require 'set'

lines = $stdin.read
array = lines.split("\n")
N = array[0].to_i
L = array[1].split(" ").map(&:to_i).sort
ans = Set.new

for a in L
  for b in L
    next if b==a
    l = L.dup.reject{|e| e==a or e==b}
    cs = l.select{|c| c < a+b and a < b+c and b < c+a}
    cs.each do |c|
      ans << [a,b,c].sort.join(",")
    end
  end
end

puts ans.length