# frozen_string_literal: true

N = gets.chomp.to_i
L = gets.chomp.split.map(&:to_i)

count = 0

L.combination(3) do |i, j, k|
  next if i == j || j == k || i == k

  triangle = [i, j, k].sort
  longest = triangle.pop
  next if longest >= triangle.sum

  count += 1
end

puts count
