first = gets
second = gets.split(" ").map(&:to_i)
res = []
second.combination(3).each do |i|
  next if i[0] > i[1] + i[2]
  next if i[1] > i[0] + i[2]
  next if i[2] > i[0] + i[2]
  next if res.flatten.include?(i[0])
  next if res.flatten.include?(i[1])
  next if res.flatten.include?(i[2])

  res push.i
end
puts res.count